mirror of
https://github.com/minio/minio.git
synced 2025-04-17 01:10:29 -04:00
avoid caching http ranges in background goroutine (#10724)
This commit is contained in:
parent
ca77ee1c0e
commit
df9894e275
@ -305,12 +305,10 @@ func (c *cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string
|
|||||||
return bkReader, bkErr
|
return bkReader, bkErr
|
||||||
}
|
}
|
||||||
|
|
||||||
if rs != nil {
|
if rs != nil && !dcache.enableRange {
|
||||||
go func() {
|
go func() {
|
||||||
// if range caching is disabled, download entire object.
|
// if range caching is disabled, download entire object.
|
||||||
if !dcache.enableRange {
|
rs = nil
|
||||||
rs = nil
|
|
||||||
}
|
|
||||||
// fill cache in the background for range GET requests
|
// fill cache in the background for range GET requests
|
||||||
bReader, bErr := c.InnerGetObjectNInfoFn(GlobalContext, bucket, object, rs, h, lockType, opts)
|
bReader, bErr := c.InnerGetObjectNInfoFn(GlobalContext, bucket, object, rs, h, lockType, opts)
|
||||||
if bErr != nil {
|
if bErr != nil {
|
||||||
@ -337,7 +335,7 @@ func (c *cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string
|
|||||||
go func() {
|
go func() {
|
||||||
putErr := dcache.Put(ctx, bucket, object,
|
putErr := dcache.Put(ctx, bucket, object,
|
||||||
io.LimitReader(pipeReader, bkReader.ObjInfo.Size),
|
io.LimitReader(pipeReader, bkReader.ObjInfo.Size),
|
||||||
bkReader.ObjInfo.Size, nil, ObjectOptions{
|
bkReader.ObjInfo.Size, rs, ObjectOptions{
|
||||||
UserDefined: userDefined,
|
UserDefined: userDefined,
|
||||||
}, false)
|
}, false)
|
||||||
// close the write end of the pipe, so the error gets
|
// close the write end of the pipe, so the error gets
|
||||||
|
Loading…
x
Reference in New Issue
Block a user