use GlobalContext whenever possible (#9280)

This change is throughout the codebase to
ensure that all codepaths honor GlobalContext
This commit is contained in:
Harshavardhana
2020-04-09 09:30:02 -07:00
committed by GitHub
parent 1b45be0d60
commit f44cfb2863
76 changed files with 374 additions and 409 deletions

View File

@@ -817,7 +817,7 @@ func (o *ObjectInfo) EncryptedSize() int64 {
// This cannot happen since AWS S3 allows parts to be 5GB at most
// sio max. size is 256 TB
reqInfo := (&logger.ReqInfo{}).AppendTags("size", strconv.FormatUint(size, 10))
ctx := logger.SetReqInfo(context.Background(), reqInfo)
ctx := logger.SetReqInfo(GlobalContext, reqInfo)
logger.CriticalIf(ctx, err)
}
return int64(size)
@@ -845,7 +845,7 @@ func DecryptCopyObjectInfo(info *ObjectInfo, headers http.Header) (errCode APIEr
}
var err error
if info.Size, err = info.DecryptedSize(); err != nil {
errCode = toAPIErrorCode(context.Background(), err)
errCode = toAPIErrorCode(GlobalContext, err)
}
}
return