Browse Source

Merge branch 'zouap_static' of openi.pcl.ac.cn:OpenI/aiforge into zouap_static

tags/v1.22.11.2^2
chenshihai 3 years ago
parent
commit
5e64fa747e
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      routers/repo/attachment.go

+ 5
- 2
routers/repo/attachment.go View File

@@ -552,7 +552,7 @@ func GetSuccessChunks(ctx *context.Context) {
fileName := ctx.Query("file_name")
scene := ctx.Query("scene")
modeluuid := ctx.Query("modeluuid")
log.Info("scene=" + scene)
log.Info("scene=" + scene + " typeCloudBrain=" + fmt.Sprint(typeCloudBrain))
var chunks string

err := checkTypeCloudBrain(typeCloudBrain)
@@ -668,6 +668,7 @@ func GetSuccessChunks(ctx *context.Context) {
dbmodeluuid := attach.Description
modelname := ""
if dbmodeluuid != modeluuid {
log.Info("The file has uploaded.fileChunk.ObjectName=" + fileChunk.ObjectName + " typeCloudBrain=" + fmt.Sprint(typeCloudBrain))
model, err := models.QueryModelById(dbmodeluuid)
if err == nil {
modelname = model.Name
@@ -676,7 +677,8 @@ func GetSuccessChunks(ctx *context.Context) {
srcObjectName := fileChunk.ObjectName
destObjectName := getObjectName(fileName, modeluuid)
var isExist bool
if typeCloudBrain == models.TypeCloudBrainOne {
if typeCloudBrain == int(models.TypeCloudBrainOne) {
log.Info("minio copy..")
bucketName := setting.Attachment.Minio.Bucket
if storage.MinioGetFilesSize(bucketName, []string{destObjectName}) > 0 {
isExist = true
@@ -684,6 +686,7 @@ func GetSuccessChunks(ctx *context.Context) {
storage.MinioCopyAFile(bucketName, srcObjectName, bucketName, destObjectName)
}
} else {
log.Info("obs copy..")
bucketName := setting.Bucket
if storage.ObsGetFilesSize(bucketName, []string{destObjectName}) > 0 {
isExist = true


Loading…
Cancel
Save