diff --git a/src/schema/task_data.py b/src/schema/task_data.py index 1adbe70..818cf81 100644 --- a/src/schema/task_data.py +++ b/src/schema/task_data.py @@ -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)