Method
unpinEntryAndTryDelete
(zoneId string, name string)
Source from the content-addressed store, hash-verified
| 72 | } |
| 73 | |
| 74 | func (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 | |
| 87 | func (entry *CacheEntry) clear() { |
| 88 | entry.File = nil |
Tested by
no test coverage detected