(ctx context.Context, blobID blob.ID)
| 148 | } |
| 149 | |
| 150 | func (c *contentCacheImpl) PrefetchBlob(ctx context.Context, blobID blob.ID) error { |
| 151 | var blobData gather.WriteBuffer |
| 152 | defer blobData.Close() |
| 153 | |
| 154 | // see if it's already cached before taking a lock |
| 155 | if c.pc.getPartial(ctx, BlobIDCacheKey(blobID), 0, 1, &blobData) { |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | // acquire exclusive lock for the blob. |
| 160 | c.pc.exclusiveLock(string(blobID)) |
| 161 | defer c.pc.exclusiveUnlock(string(blobID)) |
| 162 | |
| 163 | if c.pc.getPartial(ctx, BlobIDCacheKey(blobID), 0, 1, &blobData) { |
| 164 | return nil |
| 165 | } |
| 166 | |
| 167 | return c.fetchBlobInternal(ctx, blobID, &blobData) |
| 168 | } |
| 169 | |
| 170 | func (c *contentCacheImpl) CacheStorage() Storage { |
| 171 | return c.pc.cacheStorage |
nothing calls this directly
no test coverage detected