| @@ -40,13 +40,11 @@ const ( | |||||
| tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" | tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" | ||||
| tplCloudBrainBenchmarkShow base.TplName = "repo/cloudbrain/benchmark/show" | tplCloudBrainBenchmarkShow base.TplName = "repo/cloudbrain/benchmark/show" | ||||
| tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit" | |||||
| tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit" | |||||
| tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit" | |||||
| tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit" | |||||
| tplCloudBrainTrainJobNew base.TplName = "repo/cloudbrain/trainjob/new" | tplCloudBrainTrainJobNew base.TplName = "repo/cloudbrain/trainjob/new" | ||||
| tplCloudBrainTrainJobShow base.TplName = "repo/cloudbrain/trainjob/show" | tplCloudBrainTrainJobShow base.TplName = "repo/cloudbrain/trainjob/show" | ||||
| ) | ) | ||||
| var ( | var ( | ||||
| @@ -1403,11 +1401,11 @@ func SyncCloudbrainStatus() { | |||||
| maxDuration = setting.MaxDuration | maxDuration = setting.MaxDuration | ||||
| } | } | ||||
| if task.Duration >= maxDuration { | |||||
| log.Info("begin to stop job(%s), because of the duration", task.JobName) | |||||
| if task.Duration >= maxDuration && task.JobType != string(models.JobTypeTrain) { | |||||
| log.Info("begin to stop job(%s), because of the duration", task.DisplayJobName) | |||||
| err = cloudbrain.StopJob(task.JobID) | err = cloudbrain.StopJob(task.JobID) | ||||
| if err != nil { | if err != nil { | ||||
| log.Error("StopJob(%s) failed:%v", task.JobName, err) | |||||
| log.Error("StopJob(%s) failed:%v", task.DisplayJobName, err) | |||||
| continue | continue | ||||
| } | } | ||||
| task.Status = string(models.JobStopped) | task.Status = string(models.JobStopped) | ||||
| @@ -1417,7 +1415,8 @@ func SyncCloudbrainStatus() { | |||||
| task.ComputeAndSetDuration() | task.ComputeAndSetDuration() | ||||
| err = models.UpdateJob(task) | err = models.UpdateJob(task) | ||||
| if err != nil { | if err != nil { | ||||
| log.Error("UpdateJob(%s) failed:%v", task.JobName, err) | |||||
| log.Error("UpdateJob(%s) failed:%v", task.DisplayJobName, err) | |||||
| continue | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||