| @@ -187,7 +187,10 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain | |||||
| var jobID = ctx.Params(":jobid") | var jobID = ctx.Params(":jobid") | ||||
| task, err := models.GetCloudbrainByJobID(jobID) | task, err := models.GetCloudbrainByJobID(jobID) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("GetCloudbrainByJobID failed", err) | |||||
| ctx.JSON(200, map[string]string{ | |||||
| "result_code": "-1", | |||||
| "error_msg": "GetCloudbrainByJobID failed", | |||||
| }) | |||||
| return | return | ||||
| } | } | ||||
| @@ -199,11 +202,17 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| log.Error("CommitImage(%s) failed:", task.JobName, err.Error()) | 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 | 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) { | func CloudBrainStop(ctx *context.Context) { | ||||