From cfe15c3f0efc6f17467894679ad12c92a77dead4 Mon Sep 17 00:00:00 2001 From: Peter Reithofer Date: Mon, 31 Jul 2023 23:51:28 +0200 Subject: [PATCH] quick fix: change order of checks in operator First check get_is_completed to make sure that agent and unit status is synced even if generator already finished. --- mephisto/operations/operator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mephisto/operations/operator.py b/mephisto/operations/operator.py index f7e16679d..beb523f89 100644 --- a/mephisto/operations/operator.py +++ b/mephisto/operations/operator.py @@ -338,15 +338,15 @@ async def _track_and_kill_runs(self): tracked_run.force_shutdown = True if not tracked_run.force_shutdown: task_run = tracked_run.task_run - if tracked_run.task_launcher.finished_generators is False: - # If the run can still generate assignments, it's - # definitely not done - continue task_run.update_completion_progress( task_launcher=tracked_run.task_launcher ) if not task_run.get_is_completed(): continue + if tracked_run.task_launcher.finished_generators is False: + # If the run can still generate assignments, it's + # definitely not done + continue tracked_run.client_io.shutdown() tracked_run.worker_pool.shutdown()