(ctx context.Context, key string, length int64, output *gather.WriteBuffer)
| 96 | } |
| 97 | |
| 98 | func (c *PersistentCache) getPartialCacheHit(ctx context.Context, key string, length int64, output *gather.WriteBuffer) { |
| 99 | // cache hit |
| 100 | c.reportHitBytes(int64(output.Length())) |
| 101 | |
| 102 | mtime, err := c.cacheStorage.TouchBlob(ctx, blob.ID(key), c.sweep.TouchThreshold) |
| 103 | |
| 104 | c.listCacheMutex.Lock() |
| 105 | defer c.listCacheMutex.Unlock() |
| 106 | |
| 107 | if err == nil { |
| 108 | c.listCache.AddOrUpdate(blob.Metadata{ |
| 109 | BlobID: blob.ID(key), |
| 110 | Length: length, |
| 111 | Timestamp: mtime, |
| 112 | }) |
| 113 | } |
| 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) { |
no test coverage detected