fix: 修复启动事件中函数注册表大小更新的顺序
- 在初始化 mcp_handler 之后更新函数注册表大小 - 确保指标正确初始化 版本: v1.2.1
This commit is contained in:
@@ -139,15 +139,14 @@ async def startup_event():
|
||||
# 初始化数据库连接状态
|
||||
database_connections.set(1)
|
||||
|
||||
# 更新函数注册表大小
|
||||
if mcp_handler:
|
||||
function_count = len(mcp_handler.function_registry.list_all())
|
||||
function_registry_size.set(function_count)
|
||||
|
||||
# 初始化MCP协议处理器
|
||||
mcp_handler = MCPProtocolHandler(redis_client, nats_client)
|
||||
logger.info("MCP协议处理器初始化完成")
|
||||
|
||||
# 更新函数注册表大小
|
||||
function_count = len(mcp_handler.function_registry.list_all())
|
||||
function_registry_size.set(function_count)
|
||||
|
||||
# 注册NATS事件处理器
|
||||
await setup_nats_handlers()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user