set job status to error in the check_job_status scheduled task

the process_incomplete_jobs task runs through all incomplete jobs in
a loop, so it might not get a chance to update the processing_started
time of the last job before check_job_status runs again (every minute).
So before we even trigger the process_incomplete_jobs task, lets set
the status of the jobs to error, so that we don't identify them for
re-processing again.
This commit is contained in:
Leo Hemsted
2018-03-09 16:34:47 +00:00
parent f0ca3d40de
commit 64bb94af9e
4 changed files with 46 additions and 3 deletions

View File

@@ -560,6 +560,7 @@ def process_incomplete_job(job_id):
job = dao_get_job_by_id(job_id)
# reset the processing start time so that the check_job_status scheduled task doesn't pick this job up again
job.job_status = JOB_STATUS_PENDING
job.processing_started = datetime.utcnow()
dao_update_job(job)