From 2ea57a59928caad96d5b41d783750ffd93b7f1cb Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Thu, 27 Jul 2023 11:26:27 +0100 Subject: [PATCH] revert condition change --- changes.d/5650.fix.md | 1 + cylc/flow/scheduler.py | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 changes.d/5650.fix.md diff --git a/changes.d/5650.fix.md b/changes.d/5650.fix.md new file mode 100644 index 00000000000..a67abb26cc6 --- /dev/null +++ b/changes.d/5650.fix.md @@ -0,0 +1 @@ +Fix a bug preventing clean-up of finished tasks in the GUI and TUI. \ No newline at end of file diff --git a/cylc/flow/scheduler.py b/cylc/flow/scheduler.py index 3e1b4040381..7dc0d67647d 100644 --- a/cylc/flow/scheduler.py +++ b/cylc/flow/scheduler.py @@ -1755,10 +1755,11 @@ async def main_loop(self) -> None: self.timers[self.EVENT_RESTART_TIMEOUT].stop() self.is_restart_timeout_wait = False - if has_updated: + if has_updated or self.data_store_mgr.updates_pending: # Update the datastore. await self.update_data_structure(self.is_reloaded) + if has_updated: if not self.is_reloaded: # (A reload cannot un-stall workflow by itself) self.is_stalled = False @@ -1846,18 +1847,16 @@ def _update_workflow_state(self): async def update_data_structure(self, reloaded: bool = False): """Update DB, UIS, Summary data elements""" - # Add tasks that have moved from runahead to live pool. - if self.data_store_mgr.updates_pending: - # Collect/apply data store updates/deltas - self.data_store_mgr.update_data_structure(reloaded=reloaded) - # Publish updates: - if self.data_store_mgr.publish_pending: - self.data_store_mgr.publish_pending = False - self.server.publish_queue.put( - self.data_store_mgr.publish_deltas) - # Non-async sleep - yield to other threads rather - # than event loop - sleep(0) + # Collect/apply data store updates/deltas + self.data_store_mgr.update_data_structure(reloaded=reloaded) + # Publish updates: + if self.data_store_mgr.publish_pending: + self.data_store_mgr.publish_pending = False + self.server.publish_queue.put( + self.data_store_mgr.publish_deltas) + # Non-async sleep - yield to other threads rather + # than event loop + sleep(0) # Database update self.workflow_db_mgr.put_task_pool(self.pool) self.update_data_store()