MCPcopy Create free account
hub / github.com/SpecterOps/Nemesis / enforceSizeLimit

Method enforceSizeLimit

projects/frontend/src/utils/fileCache.js:106–113  ·  view source on GitHub ↗

* Remove oldest entries if cache is full (LRU)

()

Source from the content-addressed store, hash-verified

104 * Remove oldest entries if cache is full (LRU)
105 */
106 enforceSizeLimit() {
107 if (this.cache.size > this.maxSize) {
108 // Get first (oldest) entry
109 const firstKey = this.cache.keys().next().value;
110 this.cache.delete(firstKey);
111 log('[FileCache] Pruned oldest entry:', firstKey);
112 }
113 }
114
115 /**
116 * Clear entire cache

Callers 1

setMethod · 0.95

Calls 2

logFunction · 0.85
deleteMethod · 0.80

Tested by

no test coverage detected