Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Nov 16, 2023
1 parent c730453 commit c0aab7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/engine/src/core/workflows/executors/WorkflowExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ def _set_tasks(self, tasks):
# - All can_fail flags for a given parent task's children's task_dependency object == True
try:
for parent_task_id in self.state.dependency_graph:
parent_task = self._get_task_by_id(parent_task_id)
parent_task.can_fail = False
child_tasks = [
self._get_task_by_id(child_task_id)
for child_task_id
Expand All @@ -459,7 +461,10 @@ def _set_tasks(self, tasks):
parent_can_fail_flags.append(dep.can_fail)

# If the length of can_fail_flags == 0, then this task has no child tasks
parent_task.can_fail = False if len(parent_can_fail_flags) == 0 else all(parent_can_fail_flags)
parent_task.can_fail = (
False if len(parent_can_fail_flags) == 0
else all(parent_can_fail_flags)
)
except Exception as e:
raise Exception(f"Error resolving can_fail flag for parent task '{parent_task_id}': {e}")

Expand Down

0 comments on commit c0aab7b

Please sign in to comment.