do 2-pass cancel for workflow jobs

This commit is contained in:
AlanCoding
2018-09-11 12:08:22 -04:00
parent b9f35e5b50
commit e513f8fe31
2 changed files with 27 additions and 5 deletions

View File

@@ -50,6 +50,7 @@ class WorkflowDAG(SimpleDAG):
return [n['node_object'] for n in nodes_found]
def cancel_node_jobs(self):
cancel_finished = True
for n in self.nodes:
obj = n['node_object']
job = obj.job
@@ -57,7 +58,9 @@ class WorkflowDAG(SimpleDAG):
if not job:
continue
elif job.can_cancel:
cancel_finished = False
job.cancel()
return cancel_finished
def is_workflow_done(self):
root_nodes = self.get_root_nodes()