[router] refactor mcp to use LRU and fix pooling bug (#12346)

This commit is contained in:
Chang Su
2025-10-29 12:18:54 -07:00
committed by GitHub
parent a18161875c
commit d717e73ea8
11 changed files with 277 additions and 662 deletions
+3 -3
View File
@@ -782,12 +782,12 @@ pub async fn startup(config: ServerConfig) -> Result<(), Box<dyn std::error::Err
info!("No MCP config provided, skipping MCP server initialization");
}
// Start background refresh for all registered static MCP servers
// Start background refresh for ALL MCP servers (static + dynamic in LRU cache)
if let Some(mcp_manager) = app_context.mcp_manager.get() {
let refresh_interval = Duration::from_secs(300); // 5 minutes, matches default TTL
let refresh_interval = Duration::from_secs(600); // 10 minutes
let _refresh_handle =
Arc::clone(mcp_manager).spawn_background_refresh_all(refresh_interval);
info!("Started background refresh for all static MCP servers");
info!("Started background refresh for all MCP servers (every 10 minutes)");
}
let worker_stats = app_context.worker_registry.stats();