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

Method getEntryAndPin

pkg/filestore/blockstore_cache.go:62–72  ·  view source on GitHub ↗

will create new entries

(zoneId string, name string)

Source from the content-addressed store, hash-verified

60
61// will create new entries
62func (s *FileStore) getEntryAndPin(zoneId string, name string) *CacheEntry {
63 s.Lock.Lock()
64 defer s.Lock.Unlock()
65 entry := s.Cache[cacheKey{ZoneId: zoneId, Name: name}]
66 if entry == nil {
67 entry = makeCacheEntry(zoneId, name)
68 s.Cache[cacheKey{ZoneId: zoneId, Name: name}] = entry
69 }
70 entry.PinCount++
71 return entry
72}
73
74func (s *FileStore) unpinEntryAndTryDelete(zoneId string, name string) {
75 s.Lock.Lock()

Callers 1

withLockFunction · 0.80

Calls 1

makeCacheEntryFunction · 0.85

Tested by

no test coverage detected