Retry process_ses_results if it fails

If the SES task fails retry every 5 mins for an hour.

- Updated the process_ses_results task to retry
- Added tests to check for retry
This commit is contained in:
Richard Chapman
2017-10-24 16:58:39 +01:00
parent 0494ef3ea7
commit c2f2d39d22
2 changed files with 55 additions and 4 deletions

View File

@@ -550,7 +550,10 @@ def process_incomplete_job(job_id):
job_complete(job, job.service, template, resumed=True)
@notify_celery.task(bind=True, name='process-ses-result')
@notify_celery.task(bind=True, name="process-ses-result", max_retries=12, default_retry_delay=300000)
@statsd(namespace="tasks")
def process_ses_results(self, response):
process_ses_response(response)
errors = process_ses_response(response)
if errors:
current_app.logger.error(errors)
self.retry(queue=QueueNames.RETRY, exc="SES responses processed with error")