MCPcopy Create free account
hub / github.com/astercloud/aster / cleanupMemory

Method cleanupMemory

pkg/tools/cache.go:414–426  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412}
413
414func (c *ToolCache) cleanupMemory() {
415 c.memoryMu.Lock()
416 defer c.memoryMu.Unlock()
417
418 for key, entry := range c.memoryCache {
419 if entry.IsExpired() {
420 delete(c.memoryCache, key)
421 c.stats.ItemCount--
422 c.stats.TotalSize -= entry.Size
423 c.stats.Evictions++
424 }
425 }
426}
427
428func (c *ToolCache) cleanupFiles() {
429 if _, err := os.Stat(c.config.CacheDir); os.IsNotExist(err) {

Callers 1

cleanupMethod · 0.95

Calls 2

deleteFunction · 0.85
IsExpiredMethod · 0.80

Tested by

no test coverage detected