P1-2: 统一Dify调用点 - 删除detect-intent死链路(approval/byod) + routing_service共享client修复连接泄漏 + 前端死代码清理

This commit is contained in:
Simon
2026-07-18 01:05:20 +08:00
parent af392f2bf0
commit aeb4e0cf39
5 changed files with 54 additions and 424 deletions
+10
View File
@@ -215,6 +215,16 @@ async def cleanup_shared_services():
logger.warning(f"AIService 连接池关闭异常: {e}")
_shared_ai_handler = None
# v4.0 P1-2: 关闭 routing_service 的共享 httpx 连接池
try:
from app.services import routing_service
if routing_service._routing_client and not routing_service._routing_client.is_closed:
await routing_service._routing_client.aclose()
routing_service._routing_client = None
logger.info("routing_service httpx 连接池已关闭")
except Exception as e:
logger.warning(f"routing_service 连接池关闭异常: {e}")
# Token 黑名单 Key 前缀(与 auth.py 中保持一致)
TOKEN_BLACKLIST_PREFIX = "token:blacklist:"