Skip to content

Commit

Permalink
fix task status evaluation (#96)
Browse files Browse the repository at this point in the history
Co-authored-by: ANASOFT\keppert <[email protected]>
  • Loading branch information
peterkeppert and peterkeppert-anasoft authored Nov 20, 2024
1 parent aaf914d commit 2bd7a6b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/schema/task_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ def add_and_draw_task_data(self, task_data: TaskData) -> None:
# Status label always shows the last newly started task
status.update(label=f"""Task: {task_data.name}""")
self.current_task_data[task_data.run_id] = task_data
if all(entry.completed() for entry in self.current_task_data.values()):
# Status is "error" if any task has errored
if any(entry.completed_with_error() for entry in self.current_task_data.values()):
state = "error"
# Status is "complete" if all tasks have completed successfully
else:
state = "complete"
# Status is "running" until all tasks have completed
if not any(entry.completed() for entry in self.current_task_data.values()):
state = "running"
# Status is "error" if any task has errored
elif any(entry.completed_with_error() for entry in self.current_task_data.values()):
state = "error"
# Status is "complete" if all tasks have completed successfully
else:
state = "complete"
state = "running"
status.update(state=state)

0 comments on commit 2bd7a6b

Please sign in to comment.