MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / prewarmCaches

Method prewarmCaches

server/src/http.ts:8761–8781  ·  view source on GitHub ↗
(agents: any[])

Source from the content-addressed store, hash-verified

8759 }
8760
8761 private async prewarmCaches(agents: any[]): Promise<void> {
8762 await Promise.all(
8763 agents.map(async (agent) => {
8764 try {
8765 // Warm health and stats caches
8766 await Promise.all([
8767 this.healthChecker.checkHealth(agent),
8768 this.healthChecker.getStats(agent),
8769 this.capabilityDiscovery.discoverCapabilities(agent),
8770 ]);
8771
8772 // Warm type-specific caches
8773 if (agent.type === "buying") {
8774 await this.propertiesService.getPropertiesForAgent(agent);
8775 }
8776 } catch (error) {
8777 // Errors are expected for offline agents, just continue
8778 }
8779 })
8780 );
8781 }
8782}

Callers 1

startMethod · 0.95

Calls 4

checkHealthMethod · 0.80
discoverCapabilitiesMethod · 0.80
getStatsMethod · 0.45
getPropertiesForAgentMethod · 0.45

Tested by

no test coverage detected