Browse Source

增加代码,解决Bug

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.11.2^2
zouap 3 years ago
parent
commit
0c933bbb5f
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      routers/repo/attachment.go

+ 8
- 7
routers/repo/attachment.go View File

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


Loading…
Cancel
Save