From 1d01f70541301f006577ca4453b4464c38d09f61 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 14 Nov 2022 15:51:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=AD=EF=BC=8CNPU=E7=9A=84=E8=A7=84=E6=A0=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/attachment.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 555330491..8cea9272d 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -552,7 +552,7 @@ func GetSuccessChunks(ctx *context.Context) { fileName := ctx.Query("file_name") scene := ctx.Query("scene") modeluuid := ctx.Query("modeluuid") - log.Info("scene=" + scene) + log.Info("scene=" + scene + " typeCloudBrain=" + fmt.Sprint(typeCloudBrain)) var chunks string err := checkTypeCloudBrain(typeCloudBrain) @@ -668,6 +668,7 @@ func GetSuccessChunks(ctx *context.Context) { dbmodeluuid := attach.Description modelname := "" if dbmodeluuid != modeluuid { + log.Info("The file has uploaded.fileChunk.ObjectName=" + fileChunk.ObjectName) model, err := models.QueryModelById(dbmodeluuid) if err == nil { modelname = model.Name From 85399a00d5b4d5e44253272a10d389e53ed84606 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 14 Nov 2022 15:56:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=AD=EF=BC=8CNPU=E7=9A=84=E8=A7=84=E6=A0=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/attachment.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 8cea9272d..756c80d21 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -668,7 +668,7 @@ func GetSuccessChunks(ctx *context.Context) { dbmodeluuid := attach.Description modelname := "" if dbmodeluuid != modeluuid { - log.Info("The file has uploaded.fileChunk.ObjectName=" + fileChunk.ObjectName) + log.Info("The file has uploaded.fileChunk.ObjectName=" + fileChunk.ObjectName + " typeCloudBrain=" + fmt.Sprint(typeCloudBrain)) model, err := models.QueryModelById(dbmodeluuid) if err == nil { modelname = model.Name @@ -677,7 +677,8 @@ func GetSuccessChunks(ctx *context.Context) { srcObjectName := fileChunk.ObjectName destObjectName := getObjectName(fileName, modeluuid) var isExist bool - if typeCloudBrain == models.TypeCloudBrainOne { + if typeCloudBrain == int(models.TypeCloudBrainOne) { + log.Info("minio copy..") bucketName := setting.Attachment.Minio.Bucket if storage.MinioGetFilesSize(bucketName, []string{destObjectName}) > 0 { isExist = true @@ -685,6 +686,7 @@ func GetSuccessChunks(ctx *context.Context) { storage.MinioCopyAFile(bucketName, srcObjectName, bucketName, destObjectName) } } else { + log.Info("obs copy..") bucketName := setting.Bucket if storage.ObsGetFilesSize(bucketName, []string{destObjectName}) > 0 { isExist = true