MCPcopy
hub / github.com/kopia/kopia / deleteInvalidBlob

Method deleteInvalidBlob

internal/cache/persistent_lru_cache.go:116–128  ·  view source on GitHub ↗
(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

114}
115
116func (c *PersistentCache) deleteInvalidBlob(ctx context.Context, key string) {
117 if err := c.cacheStorage.DeleteBlob(ctx, blob.ID(key)); err != nil && !errors.Is(err, blob.ErrBlobNotFound) {
118 log(ctx).Errorf("unable to delete %v entry %v: %v", c.description, key, err)
119 return
120 }
121
122 c.listCacheMutex.Lock()
123 defer c.listCacheMutex.Unlock()
124
125 if i, ok := c.listCache.index[blob.ID(key)]; ok {
126 heap.Remove(&c.listCache, i)
127 }
128}
129
130// getPartial fetches the contents of a cached blob when (length < 0) or a subset
131// of it (when length >= 0) and returns true if it is found.

Callers 1

getPartialMethod · 0.95

Calls 6

IDTypeAlias · 0.92
ErrorfMethod · 0.80
DeleteBlobMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected