mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-11 13:11:17 -05:00
change countdown from 30 to 60 seconds for message sends to better match batch insert timing
This commit is contained in:
@@ -324,7 +324,7 @@ def batch_insert_notifications(self):
|
||||
current_app.logger.exception("Notification batch insert failed")
|
||||
for n in batch:
|
||||
# Use 'created_at' as a TTL so we don't retry infinitely
|
||||
if datetime.fromisoformat(n.created_at) < utc_now() - timedelta(minutes=1):
|
||||
if datetime.fromisoformat(n.created_at) < utc_now() - timedelta(seconds=50):
|
||||
current_app.logger.warning(
|
||||
f"Abandoning stale data, could not write to db: {n.serialize_for_redis(n)}"
|
||||
)
|
||||
|
||||
@@ -256,7 +256,7 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i
|
||||
)
|
||||
)
|
||||
provider_tasks.deliver_sms.apply_async(
|
||||
[str(saved_notification.id)], queue=QueueNames.SEND_SMS, countdown=30
|
||||
[str(saved_notification.id)], queue=QueueNames.SEND_SMS, countdown=60
|
||||
)
|
||||
|
||||
current_app.logger.debug(
|
||||
|
||||
@@ -174,7 +174,7 @@ def send_notification_to_queue_detached(
|
||||
deliver_task = provider_tasks.deliver_email
|
||||
|
||||
try:
|
||||
deliver_task.apply_async([str(notification_id)], queue=queue, countdown=30)
|
||||
deliver_task.apply_async([str(notification_id)], queue=queue, countdown=60)
|
||||
except Exception:
|
||||
dao_delete_notifications_by_id(notification_id)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user