3D模型数据资源备份镜像批量处理

This commit is contained in:
momo 2023-11-21 14:33:52 +08:00
parent 3749f04e6a
commit d074a56b83

View File

@ -7,7 +7,6 @@ import (
"fusenapi/utils/s3url_to_s3id" "fusenapi/utils/s3url_to_s3id"
"regexp" "regexp"
"strings" "strings"
"time"
"context" "context"
@ -140,13 +139,10 @@ func (l *ResourceBackupLogic) ResourceBackup(req *types.ResourceBackupReq, useri
upload.AliyunOSS.Endpoint = l.svcCtx.Config.AliyunOSS.Endpoint upload.AliyunOSS.Endpoint = l.svcCtx.Config.AliyunOSS.Endpoint
upload.AliyunOSS.BasePath = l.svcCtx.Config.AliyunOSS.BasePath upload.AliyunOSS.BasePath = l.svcCtx.Config.AliyunOSS.BasePath
for k, v := range urls { for k, v := range urls {
var resourceId = k err := upload.UploadFileByUrl(k, v, 2)
time.AfterFunc(time.Second*1, func() { if err != nil {
err := upload.UploadFileByUrl(resourceId, v, 2) l.Logger.Errorf("更新文件镜像备份, err: %v, key: %v, val:%v", err, k, v)
if err != nil { }
l.Logger.Errorf("更新文件镜像备份, err: %v, key: %v, val:%v", err, k, v)
}
})
} }
return resp.SetStatus(basic.CodeOK) return resp.SetStatus(basic.CodeOK)
} }