|
|
|
@@ -400,6 +400,21 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { |
|
|
|
} else { |
|
|
|
duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) |
|
|
|
} |
|
|
|
if benchmarkTypes.BenchmarkType != nil { |
|
|
|
for _, benchmarkType := range benchmarkTypes.BenchmarkType { |
|
|
|
if task.BenchmarkTypeID == benchmarkType.Id { |
|
|
|
ctx.Data["BenchmarkTypeName"] = benchmarkType.First |
|
|
|
for _, benchmarkChildType := range benchmarkType.Second { |
|
|
|
if task.BenchmarkChildTypeID == benchmarkChildType.Id { |
|
|
|
ctx.Data["BenchmarkChildTypeName"] = benchmarkChildType.Value |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["duration"] = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) |
|
|
|
ctx.Data["task"] = task |
|
|
|
ctx.Data["jobID"] = jobID |
|
|
|
@@ -445,7 +460,7 @@ func CloudBrainStop(ctx *context.Context) { |
|
|
|
|
|
|
|
task := ctx.Cloudbrain |
|
|
|
for { |
|
|
|
if task.Status == string(models.JobStopped) || task.Status == string(models.JobFailed) || task.Status == string(models.JobSucceeded){ |
|
|
|
if task.Status == string(models.JobStopped) || task.Status == string(models.JobFailed) || task.Status == string(models.JobSucceeded) { |
|
|
|
log.Error("the job(%s) has been stopped", task.JobName, ctx.Data["msgID"]) |
|
|
|
resultCode = "-1" |
|
|
|
errorMsg = "system error" |
|
|
|
|