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

@ -188,6 +188,9 @@ func (d *MediaTrack) Put(ctx context.Context, dstDir model.Obj, stream model.Fil
_ = tempFile.Close()
}()
uploader := s3manager.NewUploader(s)
if stream.GetSize() > s3manager.MaxUploadParts*s3manager.DefaultUploadPartSize {
uploader.PartSize = stream.GetSize() / (s3manager.MaxUploadParts - 1)
}
input := &s3manager.UploadInput{
Bucket: &resp.Data.Bucket,
Key: &resp.Data.Object,