From 2af93312e11be71c273bd758d513bb740b5d3830 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Tue, 18 Jan 2022 22:11:39 +1100 Subject: [PATCH] fix minor syntax, and make sure checkdups waits for getfiledetails not run_ai_on, to avoid the ai job failing due to no ref images, and then withdrawing the checkdups and the ai job cannot create a duplicate --- pa_job_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pa_job_manager.py b/pa_job_manager.py index a4fe134..1b1670c 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -552,7 +552,8 @@ def JobsForPaths( parent_job, paths, ptype ): if parent_job: AddLogForJob(parent_job, f"adding job id={job3.id} {job3.name} (wait for: {job3.wait_for})") - job4=Job(start_time=now, last_update=now, name="checkdups", state="New", wait_for=job3.id, pa_job_state="New", current_file_num=0 ) + # careful here, wait for getfiledetails, the ai job cannot cause a dup, but it can fail - in which case the checkdup will be withdrawn + job4=Job(start_time=now, last_update=now, name="checkdups", state="New", wait_for=job2.id, pa_job_state="New", current_file_num=0 ) session.add(job4) session.commit() if parent_job: @@ -693,7 +694,7 @@ def FinishJob(job, last_log, state="Completed", pa_job_state="Completed"): job.last_update=datetime.now(pytz.utc) AddLogForJob(job, last_log) if job.state=="Failed": - WithdrawDependantJobs( job, job.id, "failed" ): + WithdrawDependantJobs( job, job.id, "failed" ) session.commit() if DEBUG: print( f"DEBUG: {last_log}" )