cache: in writeback mode skip etag verification (#13781)

if the commit is still in pending or failed status

This PR also does some minor code cleanup
This commit is contained in:
Poorna K
2021-11-30 10:22:42 -08:00
committed by GitHub
parent 4f3290309e
commit d21466f595
3 changed files with 21 additions and 4 deletions

View File

@@ -808,10 +808,6 @@ func (c *diskCache) GetLockContext(ctx context.Context, bucket, object string) (
// Caches the object to disk
func (c *diskCache) Put(ctx context.Context, bucket, object string, data io.Reader, size int64, rs *HTTPRangeSpec, opts ObjectOptions, incHitsOnly, writeback bool) (oi ObjectInfo, err error) {
if !c.diskSpaceAvailable(size) {
io.Copy(ioutil.Discard, data)
return oi, errDiskFull
}
cLock, lkctx, err := c.GetLockContext(ctx, bucket, object)
if err != nil {
return oi, err