mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
parent
bb942c7311
commit
978bd4e2c4
@ -206,7 +206,7 @@ func (c *cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string
|
|||||||
c.incHitsToMeta(ctx, dcache, bucket, object, cacheReader.ObjInfo.Size, cacheReader.ObjInfo.ETag)
|
c.incHitsToMeta(ctx, dcache, bucket, object, cacheReader.ObjInfo.Size, cacheReader.ObjInfo.ETag)
|
||||||
return cacheReader, nil
|
return cacheReader, nil
|
||||||
}
|
}
|
||||||
if cc.noStore {
|
if cc != nil && cc.noStore {
|
||||||
c.cacheStats.incMiss()
|
c.cacheStats.incMiss()
|
||||||
bReader, err := c.GetObjectNInfo(ctx, bucket, object, rs, h, lockType, opts)
|
bReader, err := c.GetObjectNInfo(ctx, bucket, object, rs, h, lockType, opts)
|
||||||
bReader.ObjInfo.CacheLookupStatus = CacheHit
|
bReader.ObjInfo.CacheLookupStatus = CacheHit
|
||||||
@ -390,7 +390,7 @@ func (c *cacheObjects) CopyObject(ctx context.Context, srcBucket, srcObject, dst
|
|||||||
// if currently cached, evict old entry and revert to backend.
|
// if currently cached, evict old entry and revert to backend.
|
||||||
if cachedObjInfo, _, cerr := dcache.Stat(ctx, srcBucket, srcObject); cerr == nil {
|
if cachedObjInfo, _, cerr := dcache.Stat(ctx, srcBucket, srcObject); cerr == nil {
|
||||||
cc := cacheControlOpts(cachedObjInfo)
|
cc := cacheControlOpts(cachedObjInfo)
|
||||||
if !cc.isStale(cachedObjInfo.ModTime) {
|
if cc == nil || !cc.isStale(cachedObjInfo.ModTime) {
|
||||||
dcache.Delete(ctx, srcBucket, srcObject)
|
dcache.Delete(ctx, srcBucket, srcObject)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user