Browse Source

提交代码,更新最后结束时间。

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

+ 4
- 0
routers/repo/aisafety.go View File

@@ -291,6 +291,7 @@ func queryTaskStatusFromCloudbrain(job *models.Cloudbrain) {
} else {
//
job.Status = string(models.ModelSafetyTesting)
job.EndTime = 0
err = models.UpdateJob(job)
if err != nil {
log.Error("UpdateJob failed:", err)
@@ -443,6 +444,9 @@ func updateJobFailed(job *models.Cloudbrain, msg string) {
//update task failed.
job.Status = string(models.ModelArtsTrainJobFailed)
job.ResultJson = msg
job.EndTime = timeutil.TimeStampNow()
job.Duration = (int64(job.EndTime) - int64(job.StartTime)) / 1000
job.TrainJobDuration = models.ConvertDurationToStr(job.Duration)
err := models.UpdateJob(job)
if err != nil {
log.Error("UpdateJob failed:", err)


Loading…
Cancel
Save