🐛 Try to optimize the uploading

This commit is contained in:
LittleSheep 2025-03-23 02:38:20 +08:00
parent 347b1bad77
commit 2d4034d7f8

View File

@ -100,9 +100,12 @@ func ReUploadFile(meta models.Attachment, dst int, doNotUpdate ...bool) error {
} }
_, err = client.FPutObject(context.Background(), destConfigured.Bucket, filepath.Join(destConfigured.Path, meta.Uuid), inDst, minio.PutObjectOptions{ _, err = client.FPutObject(context.Background(), destConfigured.Bucket, filepath.Join(destConfigured.Path, meta.Uuid), inDst, minio.PutObjectOptions{
ContentType: meta.MimeType, ContentType: meta.MimeType,
SendContentMd5: false, SendContentMd5: false,
DisableContentSha256: true, DisableContentSha256: true,
PartSize: 10 * 1024 * 1024,
ConcurrentStreamParts: true,
NumThreads: 4,
}) })
if err != nil { if err != nil {
return fmt.Errorf("unable to upload file to s3: %v", err) return fmt.Errorf("unable to upload file to s3: %v", err)