Browse Source

Merge branch 'V20211213' into zouap

pull/1046/head
zhoupzh 3 years ago
parent
commit
0a1460d2e0
2 changed files with 3 additions and 12 deletions
  1. +1
    -7
      routers/repo/cloudbrain.go
  2. +2
    -5
      routers/repo/modelarts.go

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

@@ -70,14 +70,8 @@ func CloudBrainIndex(ctx *context.Context) {
return return
} }


timestamp := time.Now().Unix()
for i, task := range ciTasks { for i, task := range ciTasks {
if task.Status == string(models.JobRunning) && (timestamp-int64(task.Cloudbrain.CreatedUnix) > 10) {
ciTasks[i].CanDebug = cloudbrain.CanCreateOrDebugJob(ctx)
} else {
ciTasks[i].CanDebug = false
}

ciTasks[i].CanDebug = cloudbrain.CanCreateOrDebugJob(ctx)
ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain)


} }


+ 2
- 5
routers/repo/modelarts.go View File

@@ -69,11 +69,8 @@ func NotebookIndex(ctx *context.Context) {
} }


for i, task := range ciTasks { for i, task := range ciTasks {
if task.Status == string(models.JobRunning) {
ciTasks[i].CanDebug = cloudbrain.CanCreateOrDebugJob(ctx)
} else {
ciTasks[i].CanDebug = false
}

ciTasks[i].CanDebug = cloudbrain.CanCreateOrDebugJob(ctx)
ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain)
} }




Loading…
Cancel
Save