fix: s3 upload exceeded total allowed configured MaxUploadParts (close #5909)

This commit is contained in:
Andy Hsu
2024-01-19 12:05:10 +08:00
parent 442c2f77ea
commit 0f29a811bf
7 changed files with 25 additions and 5 deletions

View File

@ -244,6 +244,9 @@ func (d *Teambition) newUpload(ctx context.Context, dstDir model.Obj, stream mod
return err
}
uploader := s3manager.NewUploader(ss)
if stream.GetSize() > s3manager.MaxUploadParts*s3manager.DefaultUploadPartSize {
uploader.PartSize = stream.GetSize() / (s3manager.MaxUploadParts - 1)
}
input := &s3manager.UploadInput{
Bucket: &uploadToken.Upload.Bucket,
Key: &uploadToken.Upload.Key,