Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
b2cba2ebdd
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      routers/repo/aisafety.go

+ 11
- 2
routers/repo/aisafety.go View File

@@ -300,10 +300,19 @@ func queryTaskStatusFromCloudbrainTwo(job *models.Cloudbrain) {
log.Info("query train job error." + err.Error())
return
}

job.Status = modelarts.TransTrainJobStatus(result.IntStatus)
job.Duration = result.Duration
job.Duration = result.Duration / 1000
job.TrainJobDuration = result.TrainJobDuration

if job.StartTime == 0 && result.StartTime > 0 {
job.StartTime = timeutil.TimeStamp(result.StartTime / 1000)
}
job.TrainJobDuration = models.ConvertDurationToStr(job.Duration)
if job.EndTime == 0 && models.IsTrainJobTerminal(job.Status) && job.StartTime > 0 {
job.EndTime = job.StartTime.Add(job.Duration)
}
job.CorrectCreateUnix()

if job.Status != string(models.ModelArtsTrainJobCompleted) {
log.Info("CloudbrainTwo task status=" + job.Status)
err = models.UpdateJob(job)


Loading…
Cancel
Save