huaweidrive: simplify chunk size clamping found by "go fix -minmax"
This commit is contained in:
@@ -1897,11 +1897,9 @@ func (o *Object) uploadResume(ctx context.Context, in io.Reader, leaf, directory
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now upload the content in chunks
|
// Now upload the content in chunks
|
||||||
// Note 256k is the minimum chunk size according to Huawei Drive API
|
// Note 256k is the minimum chunk size and 64M the maximum
|
||||||
chunkSize := max(int64(o.fs.opt.ChunkSize), 256*1024)
|
// single upload size according to the Huawei Drive API
|
||||||
if chunkSize > 64*1024*1024 {
|
chunkSize := min(max(int64(o.fs.opt.ChunkSize), 256*1024), 64*1024*1024)
|
||||||
chunkSize = 64 * 1024 * 1024 // Maximum single upload size
|
|
||||||
}
|
|
||||||
|
|
||||||
buf := make([]byte, chunkSize)
|
buf := make([]byte, chunkSize)
|
||||||
var offset int64
|
var offset int64
|
||||||
|
|||||||
Reference in New Issue
Block a user