From d074a56b83b647f50871aa4057d1c2d624c3a63a Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 21 Nov 2023 14:33:52 +0800 Subject: [PATCH] =?UTF-8?q?3D=E6=A8=A1=E5=9E=8B=E6=95=B0=E6=8D=AE=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=A4=87=E4=BB=BD=E9=95=9C=E5=83=8F=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/internal/logic/resourcebackuplogic.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/server/resource/internal/logic/resourcebackuplogic.go b/server/resource/internal/logic/resourcebackuplogic.go index 3c9119ac..d4f0db08 100644 --- a/server/resource/internal/logic/resourcebackuplogic.go +++ b/server/resource/internal/logic/resourcebackuplogic.go @@ -7,7 +7,6 @@ import ( "fusenapi/utils/s3url_to_s3id" "regexp" "strings" - "time" "context" @@ -140,13 +139,10 @@ func (l *ResourceBackupLogic) ResourceBackup(req *types.ResourceBackupReq, useri upload.AliyunOSS.Endpoint = l.svcCtx.Config.AliyunOSS.Endpoint upload.AliyunOSS.BasePath = l.svcCtx.Config.AliyunOSS.BasePath for k, v := range urls { - var resourceId = k - time.AfterFunc(time.Second*1, func() { - err := upload.UploadFileByUrl(resourceId, v, 2) - if err != nil { - l.Logger.Errorf("更新文件镜像备份, err: %v, key: %v, val:%v", err, k, v) - } - }) + err := upload.UploadFileByUrl(k, v, 2) + if err != nil { + l.Logger.Errorf("更新文件镜像备份, err: %v, key: %v, val:%v", err, k, v) + } } return resp.SetStatus(basic.CodeOK) }