refactor: 统一 Redis 连接管理,改用 RedisService

- App 启动时初始化 RedisService,关闭时释放连接
- Celery worker 通过 worker_process_init 钩子初始化 Redis
- Agent 端点改用 RedisService 替代直接创建连接
- Celery task 改为 async def,使用统一连接
- 删除无用的 infra 模块和 core/http/models
- 日志脱敏,不记录 Redis 密码
- 初始化失败时 fail-fast
- 异常发布添加二级保护
This commit is contained in:
qzl
2026-03-06 16:09:15 +08:00
parent c5ccfc4b88
commit 2c59fe5ee2
14 changed files with 101 additions and 150 deletions
@@ -15,16 +15,6 @@ def test_app_health_returns_envelope() -> None:
assert body["status"] == "ok"
def test_mobile_router_health_returns_envelope() -> None:
client = TestClient(app)
response = client.get("/api/v1/health")
assert response.status_code == 200
body = response.json()
assert body["status"] == "ok"
def test_not_found_returns_error_envelope() -> None:
client = TestClient(app)