From f3569c2701ce5fa0ea4dff8d7c000084f3ee0b37 Mon Sep 17 00:00:00 2001 From: liugq Date: Mon, 9 Oct 2023 09:36:50 +0800 Subject: [PATCH] support restart cluster comparison task --- plugin/task_manager/common_api.go | 2 +- plugin/task_manager/util/orm.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/task_manager/common_api.go b/plugin/task_manager/common_api.go index 4400cf7b..6bed3af8 100644 --- a/plugin/task_manager/common_api.go +++ b/plugin/task_manager/common_api.go @@ -189,7 +189,7 @@ func (h *APIHandler) startTask(w http.ResponseWriter, req *http.Request, ps http h.WriteError(w, fmt.Sprintf("task [%s] not found", taskID), http.StatusInternalServerError) return } - if obj.Metadata.Type != "pipeline" && obj.Status == task.StatusComplete { + if obj.Metadata.Type != "pipeline" && (obj.Status == task.StatusComplete && obj.Metadata.Type != "cluster_comparison") { h.WriteError(w, fmt.Sprintf("[%s] task [%s] completed, can't start anymore", obj.Metadata.Type, taskID), http.StatusInternalServerError) return } diff --git a/plugin/task_manager/util/orm.go b/plugin/task_manager/util/orm.go index 99506721..faa65d00 100644 --- a/plugin/task_manager/util/orm.go +++ b/plugin/task_manager/util/orm.go @@ -242,7 +242,7 @@ func UpdateStoppedChildTasksToReady(taskItem *task.Task, taskType string) error }, { "terms": util.MapStr{ - "status": []string{task.StatusError, task.StatusStopped}, + "status": []string{task.StatusError, task.StatusStopped, task.StatusComplete}, }, }, {