Skip to content

Commit

Permalink
Delete public DB if private DB does not exist on scheduler start (#6070)
Browse files Browse the repository at this point in the history
Wipe pub DB if pri DB does not exist on scheduler start
  • Loading branch information
MetRonnie authored Apr 19, 2024
1 parent 599bb80 commit 9abced9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ def __init__(self, id_: str, options: 'Values') -> None:
pub_d=os.path.join(self.workflow_run_dir, 'log')
)
self.is_restart = Path(self.workflow_db_mgr.pri_path).is_file()
if (
not self.is_restart
and Path(self.workflow_db_mgr.pub_path).is_file()
):
# Delete pub DB if pri DB doesn't exist, as we don't want to
# load anything (e.g. template variables) from it
os.unlink(self.workflow_db_mgr.pub_path)

# Map used to track incomplete remote inits for restart
# {install_target: platform}
Expand Down

0 comments on commit 9abced9

Please sign in to comment.