From 44bbf463434651f837a85a92979c13ab66991b7d Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 9 Jan 2023 17:05:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=9A=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E6=97=A5=E5=BF=97=E4=B8=8B=E8=BD=BD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- modules/storage/obs.go | 4 ++-- routers/repo/modelarts.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/storage/obs.go b/modules/storage/obs.go index 3943a5f29..cc621cc3c 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -634,10 +634,10 @@ func GetObsLogFileName(prefix string) ([]FileInfo, error) { log.Info("log fileName=" + val.Key) fileInfo := FileInfo{ ModTime: val.LastModified.Local().Format("2006-01-02 15:04:05"), - FileName: val.Key, + FileName: val.Key[len(prefix)-3:], //加上 job Size: val.Size, IsDir: false, - ParenDir: "", + ParenDir: prefix[0 : len(prefix)-3], } fileInfos = append(fileInfos, fileInfo) } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 11f0b2e9b..7ffe5fef3 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -2894,9 +2894,9 @@ func TrainJobDownloadLogFile(ctx *context.Context) { return } if len(key) > 1 { - ObsDownloadManyFile("", ctx, task.DisplayJobName+".zip", key) + ObsDownloadManyFile(prefix[0:len(prefix)-3], ctx, task.DisplayJobName+".zip", key) } else { - url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].FileName) + url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].ParenDir+key[0].FileName) if err != nil { log.Error("GetObsCreateSignedUrlByBucketAndKey failed: %v", err.Error(), ctx.Data["msgID"]) ctx.ServerError("GetObsCreateSignedUrlByBucketAndKey", err)