Close CacheReader before clearing cache entry if object is deleted (#7555)

Fixes: #7549
master
poornas 6 years ago committed by Nitish Tiwari
parent ab7252831e
commit 1d49295943
  1. 1
      cmd/disk-cache.go

@ -200,6 +200,7 @@ func (c cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string,
return cacheReader, nil
} else if err != nil {
if _, ok := err.(ObjectNotFound); ok {
cacheReader.Close()
// Delete cached entry if backend object was deleted.
dcache.Delete(ctx, bucket, object)
}

Loading…
Cancel
Save