Browse Source

Merge branch 'V20220428' into fix-1913

tags/v1.22.4.2^2
zhoupzh 3 years ago
parent
commit
d75584f03a
1 changed files with 7 additions and 8 deletions
  1. +7
    -8
      routers/repo/cloudbrain.go

+ 7
- 8
routers/repo/cloudbrain.go View File

@@ -40,13 +40,11 @@ const (
tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new"
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"
tplCloudBrainTrainJobShow base.TplName = "repo/cloudbrain/trainjob/show"

)

var (
@@ -1403,11 +1401,11 @@ func SyncCloudbrainStatus() {
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)
if err != nil {
log.Error("StopJob(%s) failed:%v", task.JobName, err)
log.Error("StopJob(%s) failed:%v", task.DisplayJobName, err)
continue
}
task.Status = string(models.JobStopped)
@@ -1417,7 +1415,8 @@ func SyncCloudbrainStatus() {
task.ComputeAndSetDuration()
err = models.UpdateJob(task)
if err != nil {
log.Error("UpdateJob(%s) failed:%v", task.JobName, err)
log.Error("UpdateJob(%s) failed:%v", task.DisplayJobName, err)
continue
}
}
}


Loading…
Cancel
Save