mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user