(ctx context.Context, key string)
| 114 | } |
| 115 | |
| 116 | func (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. |
no test coverage detected