Browse Source

增加代码,解决Bug

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

+ 9
- 31
routers/repo/attachment.go View File

@@ -649,7 +649,7 @@ func GetSuccessChunks(ctx *context.Context) {
}
isExist, err = storage.ObsHasObject(getCloudTwoOBSPrefix(scene, fileChunk, oldFileName))
if isExist {
log.Info("The file is exist in obs. has uploaded.")
log.Info("The file is exist in obs. has uploaded. path=" + getCloudTwoOBSPrefix(scene, fileChunk, oldFileName))
} else {
log.Info("The file is not exist in obs.")
}
@@ -668,36 +668,14 @@ func GetSuccessChunks(ctx *context.Context) {
}
}
} else {
if fileChunk.IsUploaded == models.FileUploaded {
log.Info("the file has been recorded but not uploaded")
fileChunk.IsUploaded = models.FileNotUploaded
if err = models.UpdateFileChunk(fileChunk); err != nil {
log.Error("UpdateFileChunk failed:", err.Error())
}
}

if typeCloudBrain == models.TypeCloudBrainOne {
chunks, err = storage.GetPartInfos(getChunkMinioExistObjectName(scene, fileChunk, fileName), fileChunk.UploadID)
if err != nil {
log.Error("GetPartInfos failed:%v", err.Error())
}
} else {
chunks, err = storage.GetObsPartInfos(getChunkOBSExistObjectName(scene, fileChunk, fileName), fileChunk.UploadID)
if err != nil {
log.Error("GetObsPartInfos failed:%v", err.Error())
}
}

if err != nil {
models.DeleteFileChunk(fileChunk)
ctx.JSON(200, map[string]string{
"uuid": "",
"uploaded": "0",
"uploadID": "",
"chunks": "",
})
return
}
models.DeleteFileChunk(fileChunk)
ctx.JSON(200, map[string]string{
"uuid": "",
"uploaded": "0",
"uploadID": "",
"chunks": "",
})
return
}

var attachID int64


Loading…
Cancel
Save