From 00169d2d6b1cf894f55e73830dec16176417aa15 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 8 Dec 2021 14:59:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=90=8E=E7=AB=AFcandebug=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=85=B3=E6=B3=A8=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E5=89=8D=E7=AB=AF=E6=A0=B9=E6=8D=AE=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E5=88=B7=E6=96=B0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index ae7163d77..8dcb405a2 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -71,14 +71,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) } From a355fc941594f96819322bf4547f38eee0ab2b0e Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 8 Dec 2021 15:01:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/modelarts.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 483efbc20..3994ba542 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -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) }