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))