From 92454db1086ebc7ff8838e022a1e8a6d3e068ae2 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 14 Nov 2022 18:57:45 +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 | 40 +++++++++----------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 1cdcc7905..7b7840fd8 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -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