()
| 74 | private inflightServerDiscovery = new Map<string, Promise<McpTool[]>>() |
| 75 | |
| 76 | constructor() { |
| 77 | this.cacheAdapter = createMcpCacheAdapter() |
| 78 | logger.info(`MCP Service initialized with ${getMcpCacheType()} cache`) |
| 79 | |
| 80 | if (mcpConnectionManager) { |
| 81 | this.unsubscribeConnectionManager = mcpConnectionManager.subscribe((event) => { |
| 82 | this.cacheAdapter |
| 83 | .delete(serverCacheKey(event.workspaceId, event.serverId)) |
| 84 | .catch((err) => |
| 85 | logger.warn(`Failed to invalidate cache for ${event.serverName} on listChanged:`, err) |
| 86 | ) |
| 87 | this.cacheAdapter |
| 88 | .delete(failureCacheKey(event.workspaceId, event.serverId)) |
| 89 | .catch((err) => |
| 90 | logger.warn( |
| 91 | `Failed to invalidate failure cache for ${event.serverName} on listChanged:`, |
| 92 | err |
| 93 | ) |
| 94 | ) |
| 95 | }) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | dispose(): void { |
| 100 | this.unsubscribeConnectionManager?.() |
nothing calls this directly
no test coverage detected