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

Method deleteFromMemory

pkg/tools/cache.go:283–292  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

281}
282
283func (c *ToolCache) deleteFromMemory(key string) {
284 c.memoryMu.Lock()
285 defer c.memoryMu.Unlock()
286
287 if entry, ok := c.memoryCache[key]; ok {
288 delete(c.memoryCache, key)
289 c.stats.ItemCount--
290 c.stats.TotalSize -= entry.Size
291 }
292}
293
294func (c *ToolCache) evictOldest() {
295 // 找到最旧的条目

Callers 1

DeleteMethod · 0.95

Calls 1

deleteFunction · 0.85

Tested by

no test coverage detected