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

This commit is contained in:
2022-01-18 22:11:39 +11:00
parent 5fee1b8e30
commit 2af93312e1

View File

@@ -552,7 +552,8 @@ def JobsForPaths( parent_job, paths, ptype ):
if parent_job:
AddLogForJob(parent_job, f"adding <a href='/job/{job3.id}'>job id={job3.id} {job3.name}</a> (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}" )