Skip to content

Commit

Permalink
Remove output task json only when new job starts
Browse files Browse the repository at this point in the history
  • Loading branch information
wvangeit committed Oct 23, 2024
1 parent fd8465c commit 8f8e637
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docker_scripts/parallelrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down Expand Up @@ -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"]
Expand All @@ -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)
Expand Down

0 comments on commit 8f8e637

Please sign in to comment.