s3: Fix uploading files bigger than 50GB - fixes #386
This commit is contained in:
parent
e57c4406f3
commit
a1323eb204
1 changed files with 8 additions and 0 deletions
8
s3/s3.go
8
s3/s3.go
|
@ -761,6 +761,14 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) error {
|
||||||
u.Concurrency = 2
|
u.Concurrency = 2
|
||||||
u.LeavePartsOnError = false
|
u.LeavePartsOnError = false
|
||||||
u.S3 = o.fs.c
|
u.S3 = o.fs.c
|
||||||
|
u.PartSize = s3manager.MinUploadPartSize
|
||||||
|
size := src.Size()
|
||||||
|
|
||||||
|
// Adjust PartSize until the number of parts is small enough.
|
||||||
|
if size/u.PartSize >= s3manager.MaxUploadParts {
|
||||||
|
// Calculate partition size rounded up to the nearest MB
|
||||||
|
u.PartSize = (((size / s3manager.MaxUploadParts) >> 20) + 1) << 20
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Set the mtime in the meta data
|
// Set the mtime in the meta data
|
||||||
|
|
Loading…
Reference in a new issue