MCPcopy
hub / github.com/wavetermdev/waveterm / unpinEntryAndTryDelete

Method unpinEntryAndTryDelete

pkg/filestore/blockstore_cache.go:74–85  ·  view source on GitHub ↗
(zoneId string, name string)

Source from the content-addressed store, hash-verified

72}
73
74func (s *FileStore) unpinEntryAndTryDelete(zoneId string, name string) {
75 s.Lock.Lock()
76 defer s.Lock.Unlock()
77 entry := s.Cache[cacheKey{ZoneId: zoneId, Name: name}]
78 if entry == nil {
79 return
80 }
81 entry.PinCount--
82 if entry.PinCount <= 0 && entry.File == nil {
83 delete(s.Cache, cacheKey{ZoneId: zoneId, Name: name})
84 }
85}
86
87func (entry *CacheEntry) clear() {
88 entry.File = nil

Callers 1

withLockFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected