MCPcopy Create free account
hub / github.com/buct2012dbl/Dorchestrator / evict

Method evict

coding-agent/src/context/cache.ts:68–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 private evict(): void {
69 // LRU eviction: remove least recently used (lowest hits)
70 let minHits = Infinity;
71 let evictKey: string | null = null;
72
73 for (const [key, entry] of this.cache.entries()) {
74 if (entry.hits < minHits) {
75 minHits = entry.hits;
76 evictKey = key;
77 }
78 }
79
80 if (evictKey) {
81 this.cache.delete(evictKey);
82 }
83 }
84
85 getStats() {
86 return {

Callers 1

setMethod · 0.95

Calls 2

entriesMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected