diff --git a/app/celery/process_ses_receipts_tasks.py b/app/celery/process_ses_receipts_tasks.py index c202d6d42..c3d24504c 100644 --- a/app/celery/process_ses_receipts_tasks.py +++ b/app/celery/process_ses_receipts_tasks.py @@ -29,7 +29,7 @@ from app.utils import utc_now name="process-ses-result", max_retries=5, default_retry_delay=300, - autoretry_for=Exception, + autoretry_for=(Exception,), ) def process_ses_results(self, response): try: diff --git a/app/celery/provider_tasks.py b/app/celery/provider_tasks.py index 5784f4f57..53021d580 100644 --- a/app/celery/provider_tasks.py +++ b/app/celery/provider_tasks.py @@ -136,7 +136,7 @@ def _deliver_sms_task_handler(func): name="deliver_sms", max_retries=48, default_retry_delay=300, - autoretry_for=Exception, + autoretry_for=(Exception,), ) def deliver_sms(self, notification_id): """Branch off to the final step in delivering the notification to sns and get delivery receipts.""" @@ -217,8 +217,8 @@ def _deliver_email_task_handler(func): name="deliver_email", max_retries=48, default_retry_delay=30, - autoretry_for=Exception, - dont_autoretry_for=EmailClientNonRetryableException, + autoretry_for=(Exception,), + dont_autoretry_for=(EmailClientNonRetryableException,), ) def deliver_email(self, notification_id): try: diff --git a/app/celery/service_callback_tasks.py b/app/celery/service_callback_tasks.py index bb1a644c4..66fc56f8c 100644 --- a/app/celery/service_callback_tasks.py +++ b/app/celery/service_callback_tasks.py @@ -57,7 +57,7 @@ def _send_to_service_task_handler(func): name="send-delivery-status", max_retries=5, default_retry_delay=300, - autoretry_for=HTTPError, + autoretry_for=(HTTPError,), ) def send_delivery_status_to_service(self, notification_id, encrypted_status_update): status_update = encryption.decrypt(encrypted_status_update) @@ -90,7 +90,7 @@ def send_delivery_status_to_service(self, notification_id, encrypted_status_upda name="send-complaint", max_retries=5, default_retry_delay=300, - autoretry_for=HTTPError, + autoretry_for=(HTTPError,), ) def send_complaint_to_service(self, complaint_data): complaint = encryption.decrypt(complaint_data) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index 24d157339..149308a9a 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -198,7 +198,7 @@ def _save_task_hander(func): name="save-sms", max_retries=5, default_retry_delay=300, - autoretry_for=SQLAlchemyError, + autoretry_for=(SQLAlchemyError,), ) def save_sms(self, service_id, notification_id, encrypted_notification, sender_id=None): """Persist notification to db and place notification in queue to send to sns.""" @@ -286,7 +286,7 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i name="save-email", max_retries=5, default_retry_delay=300, - autoretry_for=SQLAlchemyError, + autoretry_for=(SQLAlchemyError,), ) def save_email( self, service_id, notification_id, encrypted_notification, sender_id=None @@ -369,7 +369,7 @@ def _save_api_task_handler(func): name="save-api-email", max_retries=5, default_retry_delay=300, - autoretry_for=SQLAlchemyError, + autoretry_for=(SQLAlchemyError,), ) def save_api_email(self, encrypted_notification): save_api_email_or_sms(self, encrypted_notification) @@ -381,7 +381,7 @@ def save_api_email(self, encrypted_notification): name="save-api-sms", max_retries=5, default_retry_delay=300, - autoretry_for=SQLAlchemyError, + autoretry_for=(SQLAlchemyError,), ) def save_api_sms(self, encrypted_notification): save_api_email_or_sms(self, encrypted_notification) @@ -453,7 +453,7 @@ def _send_inbound_sms_to_service_handler(func): name="send-inbound-sms", max_retries=5, default_retry_delay=300, - autoretry_for=RequestException, + autoretry_for=(RequestException,), ) def send_inbound_sms_to_service(self, inbound_sms_id, service_id): inbound_api = get_service_inbound_api_for_service(service_id=service_id)