From 515b8cf375e84a627394912fac51df02657c3e66 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 9 Nov 2021 17:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- modules/storage/obs.go | 1 + routers/repo/ai_model_manage.go | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/storage/obs.go b/modules/storage/obs.go index eea716725..c98e570c5 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -341,6 +341,7 @@ func GetAllObjectByBucketAndPrefix(bucket string, prefix string) ([]FileInfo, er index++ for _, val := range output.Contents { var isDir bool + log.Info("val.key=" + val.Key) if val.Key == prefix { continue } diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 807fa192c..1a267ddd1 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -192,13 +192,11 @@ func DownloadMultiModelFile(ctx *context.Context) { ctx.Resp.Header().Set("Content-Type", "application/octet-stream") allFile, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, path) if err != nil { - w := zip.NewWriter(ctx.Resp) defer w.Close() - for _, oneFile := range allFile { if !oneFile.IsDir { - log.Info("zip file name:" + oneFile.FileName) + log.Info("zip file name:" + oneFile.FileName) fDest, err := w.Create(oneFile.FileName) if err != nil { log.Info("create zip entry error, download file failed: %s\n", err.Error())