Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
788764a51f
2 changed files with 6 additions and 6 deletions
  1. +5
    -5
      modules/storage/minio_ext.go
  2. +1
    -1
      routers/repo/ai_model_manage.go

+ 5
- 5
modules/storage/minio_ext.go View File

@@ -219,11 +219,11 @@ func GetOneLevelAllObjectUnderDirMinio(bucket string, prefixRootPath string, rel

func MinioPathCopy(bucketName string, srcPath string, destPath string) (int64, error) {
_, core, err := getClients()
var count int64
count = 0
var fileTotalSize int64
fileTotalSize = 0
if err != nil {
log.Error("getClients failed:", err.Error())
return count, err
return fileTotalSize, err
}
delimiter := ""
marker := ""
@@ -235,7 +235,7 @@ func MinioPathCopy(bucketName string, srcPath string, destPath string) (int64, e
destObjectName := destPath + srcObjectName[len(srcPath):]
log.Info("srcObjectName=" + srcObjectName + " destObjectName=" + destObjectName)
core.CopyObject(bucketName, srcObjectName, bucketName, destObjectName, val.UserMetadata)
count++
fileTotalSize += val.Size
}
if output.IsTruncated {
marker = output.NextMarker
@@ -247,7 +247,7 @@ func MinioPathCopy(bucketName string, srcPath string, destPath string) (int64, e
return 0, err
}
}
return count, nil
return fileTotalSize, nil
}

func NewMultiPartUpload(uuid string) (string, error) {


+ 1
- 1
routers/repo/ai_model_manage.go View File

@@ -333,7 +333,7 @@ func downloadFromCloudBrainOne(path string, task *models.AiModelManage, ctx *con
ctx.ServerError("download file failed:", err)
return
}
body, err := storage.Attachments.Open(oneFile.FileName)
body, err := storage.Attachments.Open(path + oneFile.FileName)
if err != nil {
log.Info("download file failed: %s\n", err.Error())
ctx.ServerError("download file failed:", err)


Loading…
Cancel
Save