Browse Source

mod commit image response

tags/v1.21.12.1
yuyuanshifu 4 years ago
parent
commit
33f92463e5
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      routers/repo/cloudbrain.go

+ 12
- 3
routers/repo/cloudbrain.go View File

@@ -187,7 +187,10 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain
var jobID = ctx.Params(":jobid")
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
ctx.ServerError("GetCloudbrainByJobID failed", err)
ctx.JSON(200, map[string]string{
"result_code": "-1",
"error_msg": "GetCloudbrainByJobID failed",
})
return
}

@@ -199,11 +202,17 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain
})
if err != nil {
log.Error("CommitImage(%s) failed:", task.JobName, err.Error())
ctx.ServerError("CommitImage failed", err)
ctx.JSON(200, map[string]string{
"result_code": "-1",
"error_msg": "CommitImage failed",
})
return
}

ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain")
ctx.JSON(200, map[string]string{
"result_code": "0",
"error_msg": "",
})
}

func CloudBrainStop(ctx *context.Context) {


Loading…
Cancel
Save