Browse Source

fix-3108

tags/v1.22.11.2^2
liuzx 3 years ago
parent
commit
e69ac40f14
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      routers/api/v1/repo/cloudbrain.go

+ 14
- 2
routers/api/v1/repo/cloudbrain.go View File

@@ -596,12 +596,24 @@ func CloudbrainGetLog(ctx *context.APIContext) {
existStr = taskRes.TaskStatuses[0].ExitDiagnostics
}
ctx.Data["existStr"] = existStr
log.Info("existStr=" + existStr)
} else {
ModelSafetyGetLog(ctx)
return
}
}

if job.JobType == string(models.JobTypeTrain) {
if job.Type == models.TypeCloudBrainOne {
result, err := cloudbrain.GetJob(job.JobID)
existStr := ""
if err == nil && result != nil {
jobRes, _ := models.ConvertToJobResultPayload(result.Payload)
taskRoles := jobRes.TaskRoles
taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{}))
existStr = taskRes.TaskStatuses[0].ExitDiagnostics
}
ctx.Data["existStr"] = existStr
}
}

lines := ctx.QueryInt("lines")
@@ -634,7 +646,7 @@ func CloudbrainGetLog(ctx *context.APIContext) {
endLine += 1
}
}
result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath)
if result == nil {
log.Error("GetJobLog failed: %v", err, ctx.Data["MsgID"])


Loading…
Cancel
Save