perf: 优化数据库连接池和HTTP客户端复用 1.连接池50+30支持150-200并发 2.HTTP客户端全局复用减少开销 3.前端UI优化和默认章节调整

This commit is contained in:
xiamuceer
2025-11-22 18:23:30 +08:00
parent 45bdcabca5
commit 244aa4db4f
6 changed files with 230 additions and 79 deletions
+7
View File
@@ -49,7 +49,14 @@ async def lifespan(app: FastAPI):
# 清理MCP插件
await mcp_registry.cleanup_all()
# 清理HTTP客户端池
from app.services.ai_service import cleanup_http_clients
await cleanup_http_clients()
# 关闭数据库连接
await close_db()
logger.info("应用已关闭")