mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-12 08:12:27 -05:00
Refactor process_ses_receipt
It is possible a service has data rention that is smaller than the time it takes to get a delivery receipt. This PR refactors process_ses_receipt to update NotificationHistory if the Notifcation has already been purged.
This commit is contained in:
@@ -303,7 +303,6 @@ def save_api_email(self,
|
||||
service = dao_fetch_service_by_id(notification['service_id'])
|
||||
|
||||
try:
|
||||
current_app.logger.info(f"Persisting notification {notification['id']}")
|
||||
|
||||
persist_notification(
|
||||
notification_id=notification["id"],
|
||||
@@ -327,7 +326,7 @@ def save_api_email(self,
|
||||
[notification['id']],
|
||||
queue=q
|
||||
)
|
||||
current_app.logger.info(f"Email {notification['id']} has been persisted.")
|
||||
current_app.logger.info(f"Email {notification['id']} has been persisted and sent to delivery queue.")
|
||||
except IntegrityError:
|
||||
current_app.logger.info(f"Email {notification['id']} already exists.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user