mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-03 15:50:12 -04:00
- Added logging to indicate that we created the notification and that we sent the notification to a delivery queue.
- Small updates as recommended by review comments.
This commit is contained in:
@@ -43,6 +43,7 @@ def persist_notification(template_id,
|
||||
reference=None,
|
||||
notification_id=None,
|
||||
simulated=False):
|
||||
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
||||
notification = Notification(
|
||||
id=notification_id,
|
||||
template_id=template_id,
|
||||
@@ -62,6 +63,9 @@ def persist_notification(template_id,
|
||||
if not simulated:
|
||||
dao_create_notification(notification)
|
||||
redis_store.incr(redis.daily_limit_cache_key(service.id))
|
||||
current_app.logger.info(
|
||||
"{} {} created at {}".format(notification.notification_type, notification.id, notification.created_at)
|
||||
)
|
||||
return notification
|
||||
|
||||
|
||||
@@ -87,8 +91,9 @@ def send_notification_to_queue(notification, research_mode, queue=None):
|
||||
raise SendNotificationToQueueError()
|
||||
|
||||
current_app.logger.info(
|
||||
"{} {} created at {}".format(notification.notification_type, notification.id, notification.created_at)
|
||||
)
|
||||
"{} {} sent to the {} queue for delivery".format(notification.notification_type,
|
||||
notification.id,
|
||||
queue))
|
||||
|
||||
|
||||
def simulated_recipient(to_address, notification_type):
|
||||
|
||||
Reference in New Issue
Block a user