Revert "12/11/2024 Production Deployment API hotfixes"

This commit is contained in:
Carlo Costino
2024-12-12 09:11:59 -05:00
committed by GitHub
parent fcfb6e60d4
commit a15d81ea14
3 changed files with 6 additions and 12 deletions

View File

@@ -1,6 +1,5 @@
import json
import os
import random
from datetime import timedelta
from botocore.exceptions import ClientError
@@ -30,7 +29,8 @@ DELIVERY_RECEIPT_DELAY_IN_SECONDS = 30
@notify_celery.task(
bind=True,
name="check_sms_delivery_receipt",
max_retries=72,
max_retries=48,
default_retry_delay=300,
)
def check_sms_delivery_receipt(self, message_id, notification_id, sent_at):
"""
@@ -62,10 +62,7 @@ def check_sms_delivery_receipt(self, message_id, notification_id, sent_at):
carrier=carrier,
provider_response=provider_response,
)
base_delay = 3600 # one hour
jitter = random.randint(-1200, +1200) # nosec B311
retry_delay = base_delay + jitter
raise self.retry(countdown=retry_delay, exc=ntfe)
raise self.retry(exc=ntfe)
except ClientError as err:
# Probably a ThrottlingException but could be something else
error_code = err.response["Error"]["Code"]
@@ -80,10 +77,7 @@ def check_sms_delivery_receipt(self, message_id, notification_id, sent_at):
carrier=carrier,
provider_response=provider_response,
)
base_delay = 3600 # one hour
jitter = random.randint(-1200, +1200) # nosec B311
retry_delay = base_delay + jitter
raise self.retry(countdown=retry_delay, exc=err)
raise self.retry(exc=err)
if status == "success":
status = NotificationStatus.DELIVERED