mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[FIX] Adjust the dependent task state judgment strategy and increase the dynamic change static task
This commit is contained in:
parent
e3ac05e3d3
commit
a04047b5a0
@ -115,3 +115,9 @@ func DeleteTask(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
httputil.ReturnSuccess(r, w, nil)
|
||||
}
|
||||
|
||||
//ReloadStaticTasks 重新加载静态文件
|
||||
func ReloadStaticTasks(w http.ResponseWriter, r *http.Request) {
|
||||
taskService.ReloadStaticTasks()
|
||||
httputil.ReturnSuccess(r, w, nil)
|
||||
}
|
||||
|
@ -105,6 +105,10 @@ func Routers(mode string) *chi.Mux {
|
||||
})
|
||||
}
|
||||
})
|
||||
//重新加载task文件
|
||||
if mode == "master" {
|
||||
r.Put("/-/taskreload", controller.ReloadStaticTasks)
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
@ -183,6 +183,11 @@ func (ts *TaskService) ExecTask(taskID string, nodes []string) *utils.APIHandleE
|
||||
return nil
|
||||
}
|
||||
|
||||
//ReloadStaticTasks reload task
|
||||
func (ts *TaskService) ReloadStaticTasks() {
|
||||
ts.ms.TaskEngine.LoadStaticTask()
|
||||
}
|
||||
|
||||
//TaskTempService 任务模版
|
||||
type TaskTempService struct {
|
||||
SavePath string
|
||||
|
@ -149,7 +149,6 @@ func (n *NodeCluster) UpdateNode(node *model.HostNode) {
|
||||
n.lock.Lock()
|
||||
defer n.lock.Unlock()
|
||||
n.nodes[node.ID] = node
|
||||
logrus.Debugf("Update node %s info to etcd", node.ID)
|
||||
n.client.Put(option.Config.NodePath+"/"+node.ID, node.String())
|
||||
}
|
||||
func (n *NodeCluster) getNodeFromKV(kv *mvccpb.KeyValue) *model.HostNode {
|
||||
|
@ -659,7 +659,7 @@ func (t *TaskEngine) waitScheduleTask(taskSchedulerInfo *TaskSchedulerInfo, task
|
||||
if nodestatus, ok := depTask.Status[taskSchedulerInfo.Node]; ok && nodestatus.CompleStatus == "Success" {
|
||||
result[i] = true
|
||||
continue
|
||||
} else if ok && nodestatus.CompleStatus != "Success" {
|
||||
} else if ok && nodestatus.CompleStatus != "" {
|
||||
taskSchedulerInfo.Status.Message = fmt.Sprintf("depend task %s Condition cannot be satisfied", depTask.ID)
|
||||
taskSchedulerInfo.Status.Status = "Failure"
|
||||
task.Scheduler.Status[taskSchedulerInfo.Node] = taskSchedulerInfo.Status
|
||||
|
Loading…
Reference in New Issue
Block a user