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