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