evictStale() — mcp Function Reference
Architecture documentation for the evictStale() function in graph-cache.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD bd216705_efc6_4dc4_e563_eb99bcf30d21["evictStale()"] 6407330b_8aa1_cc04_569a_747f6b1debfd["set()"] 6407330b_8aa1_cc04_569a_747f6b1debfd -->|calls| bd216705_efc6_4dc4_e563_eb99bcf30d21 d6ed9355_f977_306b_b0ef_d7220fdefe68["get()"] bd216705_efc6_4dc4_e563_eb99bcf30d21 -->|calls| d6ed9355_f977_306b_b0ef_d7220fdefe68 style bd216705_efc6_4dc4_e563_eb99bcf30d21 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