support restart cluster comparison task

This commit is contained in:
liugq 2023-10-09 09:36:50 +08:00
parent 71ba08d266
commit f3569c2701
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -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},
},
},
{