mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
parent
7d6766adc6
commit
013773065c
@ -460,7 +460,7 @@ func (c *diskCache) saveMetadata(ctx context.Context, bucket, object string, met
|
|||||||
if m.Meta == nil {
|
if m.Meta == nil {
|
||||||
m.Meta = make(map[string]string)
|
m.Meta = make(map[string]string)
|
||||||
}
|
}
|
||||||
if etag, ok := meta["etag"]; !ok {
|
if etag, ok := meta["etag"]; ok {
|
||||||
m.Meta["etag"] = etag
|
m.Meta["etag"] = etag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ func (c *cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string
|
|||||||
oi, _, _, err := dcache.statRange(ctx, bucket, object, rs)
|
oi, _, _, err := dcache.statRange(ctx, bucket, object, rs)
|
||||||
// avoid cache overwrite if another background routine filled cache
|
// avoid cache overwrite if another background routine filled cache
|
||||||
if err != nil || oi.ETag != bReader.ObjInfo.ETag {
|
if err != nil || oi.ETag != bReader.ObjInfo.ETag {
|
||||||
dcache.Put(ctx, bucket, object, bReader, bReader.ObjInfo.Size, rs, ObjectOptions{UserDefined: getMetadata(bReader.ObjInfo)}, true)
|
dcache.Put(ctx, bucket, object, bReader, bReader.ObjInfo.Size, rs, ObjectOptions{UserDefined: getMetadata(bReader.ObjInfo)}, false)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return bkReader, bkErr
|
return bkReader, bkErr
|
||||||
@ -647,7 +647,7 @@ func (c *cacheObjects) PutObject(ctx context.Context, bucket, object string, r *
|
|||||||
oi, _, err := dcache.Stat(ctx, bucket, object)
|
oi, _, err := dcache.Stat(ctx, bucket, object)
|
||||||
// avoid cache overwrite if another background routine filled cache
|
// avoid cache overwrite if another background routine filled cache
|
||||||
if err != nil || oi.ETag != bReader.ObjInfo.ETag {
|
if err != nil || oi.ETag != bReader.ObjInfo.ETag {
|
||||||
dcache.Put(ctx, bucket, object, bReader, bReader.ObjInfo.Size, nil, ObjectOptions{UserDefined: getMetadata(bReader.ObjInfo)}, true)
|
dcache.Put(ctx, bucket, object, bReader, bReader.ObjInfo.Size, nil, ObjectOptions{UserDefined: getMetadata(bReader.ObjInfo)}, false)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user