From 8f8e6379568ec122a8de33d1bf18ec65694d6a05 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Wed, 23 Oct 2024 10:45:58 +0200 Subject: [PATCH] Remove output task json only when new job starts --- docker_scripts/parallelrunner.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker_scripts/parallelrunner.py b/docker_scripts/parallelrunner.py index 771766d..5083c35 100755 --- a/docker_scripts/parallelrunner.py +++ b/docker_scripts/parallelrunner.py @@ -44,9 +44,6 @@ def __init__(self, settings): self.output_tasks_dir_path / "output_tasks.json" ) - if self.output_tasks_path.exists(): - self.output_tasks_path.unlink() - self.caller_uuid = None self.uuid = str(uuid.uuid4()) @@ -113,7 +110,6 @@ def start(self): waiter_wrong_uuid = 0 while True: tools.wait_for_path(self.input_tasks_path) - input_dict = tools.load_json(self.input_tasks_path) command = input_dict["command"] caller_uuid = input_dict["caller_uuid"] @@ -139,6 +135,9 @@ def start(self): time.sleep(self.settings.file_polling_interval) waiter_wrong_uuid += 1 else: + if self.output_tasks_path.exists(): + self.output_tasks_path.unlink() + input_tasks = input_dict["tasks"] self.run_input_tasks(input_tasks, tasks_uuid)