1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: oss 改用分片上传与下载

This commit is contained in:
ssongliu 2023-03-15 11:16:32 +08:00 committed by ssongliu
parent 9bb28cda27
commit bfeb57e24f

View File

@ -77,7 +77,7 @@ func (oss ossClient) Upload(src, target string) (bool, error) {
if err != nil { if err != nil {
return false, err return false, err
} }
err = bucket.PutObjectFromFile(target, src) err = bucket.UploadFile(target, src, 200*1024*1024, osssdk.Routines(5), osssdk.Checkpoint(true, ""))
if err != nil { if err != nil {
return false, err return false, err
} }
@ -89,7 +89,7 @@ func (oss ossClient) Download(src, target string) (bool, error) {
if err != nil { if err != nil {
return false, err return false, err
} }
err = bucket.GetObjectToFile(src, target) err = bucket.DownloadFile(src, target, 200*1024*1024, osssdk.Routines(5), osssdk.Checkpoint(true, ""))
if err != nil { if err != nil {
return false, err return false, err
} }