evictStale() — mcp Function Reference
Architecture documentation for the evictStale() function in graph-cache.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD f25d6639_05c4_e928_c1e5_13a8b4319dce["evictStale()"] b965d3cf_dacd_81fc_77e7_dbe9bdef8bbc["set()"] b965d3cf_dacd_81fc_77e7_dbe9bdef8bbc -->|calls| f25d6639_05c4_e928_c1e5_13a8b4319dce 55bde18a_7860_173e_f211_5874970475e3["get()"] f25d6639_05c4_e928_c1e5_13a8b4319dce -->|calls| 55bde18a_7860_173e_f211_5874970475e3 style f25d6639_05c4_e928_c1e5_13a8b4319dce fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/cache/graph-cache.ts lines 337–356
evictStale(): number {
const now = Date.now();
const keysToEvict: string[] = [];
// Find all stale entries
for (const [key, entry] of this.cache) {
if (now - entry.createdAt > this.maxAgeMs) {
keysToEvict.push(key);
}
}
// Evict them
for (const key of keysToEvict) {
const entry = this.cache.get(key)!;
this.currentNodes -= entry.nodeCount;
this.cache.delete(key);
}
return keysToEvict.length;
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does evictStale() do?
evictStale() is a function in the mcp codebase.
What does evictStale() call?
evictStale() calls 1 function(s): get.
What calls evictStale()?
evictStale() is called by 1 function(s): set.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free