mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05: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:
@@ -1365,7 +1365,7 @@ def test_process_incomplete_job_sms(mocker, sample_template):
|
||||
@freeze_time('2017-01-01')
|
||||
def test_process_incomplete_job_resets_start_time(mocker, sample_template):
|
||||
mocker.patch('app.celery.tasks.s3.get_job_from_s3', return_value=load_example_csv('multiple_sms'))
|
||||
save_sms = mocker.patch('app.celery.tasks.save_sms.apply_async')
|
||||
mocker.patch('app.celery.tasks.save_sms.apply_async')
|
||||
|
||||
job = create_job(template=sample_template, notification_count=10,
|
||||
created_at=datetime.utcnow() - timedelta(hours=2),
|
||||
|
||||
Reference in New Issue
Block a user