From 0c933bbb5f82ae64f43285d41f7a60cdd36a9aff Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 14 Nov 2022 17:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/attachment.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index d5953c2d3..1cdcc7905 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -532,18 +532,20 @@ func UpdateAttachmentDecompressState(ctx *context.Context) { func getCloudOneMinioPrefix(scene string, fileChunk *models.FileChunk) string { if scene == Attachment_model { - return fileChunk.ObjectName - } else { - return setting.Attachment.Minio.BasePath + models.AttachmentRelativePath(fileChunk.UUID) + if fileChunk.ObjectName != "" { + return fileChunk.ObjectName + } } + return setting.Attachment.Minio.BasePath + models.AttachmentRelativePath(fileChunk.UUID) } func getCloudTwoOBSPrefix(scene string, fileChunk *models.FileChunk, fileName string) string { if scene == Attachment_model { - return fileChunk.ObjectName - } else { - return setting.BasePath + models.AttachmentRelativePath(fileChunk.UUID) + "/" + fileName + if fileChunk.ObjectName != "" { + return fileChunk.ObjectName + } } + return setting.BasePath + models.AttachmentRelativePath(fileChunk.UUID) + "/" + fileName } func specialDeal(modeluuid, uuid, fileName string, ctx *context.Context, fileChunk *models.FileChunk, typeCloudBrain int) { @@ -629,7 +631,6 @@ func GetSuccessChunks(ctx *context.Context) { isExist := false if typeCloudBrain == models.TypeCloudBrainOne { - isExist, err = storage.Attachments.HasObject(getCloudOneMinioPrefix(scene, fileChunk)) if isExist { log.Info("The file is exist in minio. has uploaded.path=" + getCloudOneMinioPrefix(scene, fileChunk))