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

Method cleanup

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

Source from the content-addressed store, hash-verified

398}
399
400func (c *ToolCache) cleanup() {
401 c.stats.LastCleanupAt = time.Now()
402
403 // 清理内存缓存
404 if c.config.Strategy == CacheStrategyMemory || c.config.Strategy == CacheStrategyBoth {
405 c.cleanupMemory()
406 }
407
408 // 清理文件缓存
409 if c.config.Strategy == CacheStrategyFile || c.config.Strategy == CacheStrategyBoth {
410 c.cleanupFiles()
411 }
412}
413
414func (c *ToolCache) cleanupMemory() {
415 c.memoryMu.Lock()

Callers 2

cleanupLoopMethod · 0.95
TestToolCache_CleanupFunction · 0.95

Calls 2

cleanupMemoryMethod · 0.95
cleanupFilesMethod · 0.95

Tested by 1

TestToolCache_CleanupFunction · 0.76