MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / evictOldest

Method evictOldest

src/utils/tool-cache.ts:66–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 }
65
66 private evictOldest(): void {
67 const first = this.cache.keys().next();
68 if (!first.done) {
69 const entry = this.cache.get(first.value);
70 if (entry) this.totalBytes -= entry.size;
71 this.cache.delete(first.value);
72 }
73 }
74
75 reset(): void {
76 this.cache.clear();

Callers 1

setMethod · 0.95

Calls 2

deleteMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected