Browse Source

Merge pull request '后端candebug不再关注任务状态,前端根据状态变化刷新按钮' (#1048) from fix-969 into V20211213

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1048
Reviewed-by: lewis <747342561@qq.com>
tags/v1.21.12.1^2
lewis 4 years ago
parent
commit
ed472b8a52
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
}

timestamp := time.Now().Unix()
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)

}


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

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

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)
}



Loading…
Cancel
Save