initStarted标志,导致重新初始化frontend/src/components/MainPage.tsx)cleanupInProgress标志防止重复清理initStarted.current = false,避免重复初始化backend/websocket_handler.py)start()方法:在异常时立即释放已获取的连接cleanup()方法:
backend/connection_pool.py)get_pool_status()方法,方便监控连接池状态curl http://192.168.2.105:8000/stats
返回示例:
{
"connection_pool": {
"pool_size": 10,
"idle": 5,
"active": 5
}
}
开始清理会话 {session_id}... - 会话开始清理释放会话 {session_id} 的豆包连接到连接池 - 连接被释放会话 {session_id} 没有豆包连接需要释放 - 警告:会话没有连接