mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
revert behavior for emails, only sms needs optimization
This commit is contained in:
@@ -7,6 +7,7 @@ from app import redis_store
|
|||||||
from app.celery import provider_tasks
|
from app.celery import provider_tasks
|
||||||
from app.config import QueueNames
|
from app.config import QueueNames
|
||||||
from app.dao.notifications_dao import (
|
from app.dao.notifications_dao import (
|
||||||
|
dao_create_notification,
|
||||||
dao_delete_notifications_by_id,
|
dao_delete_notifications_by_id,
|
||||||
dao_notification_exists,
|
dao_notification_exists,
|
||||||
get_notification_by_id,
|
get_notification_by_id,
|
||||||
@@ -139,18 +140,14 @@ def persist_notification(
|
|||||||
|
|
||||||
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
||||||
if not simulated:
|
if not simulated:
|
||||||
# current_app.logger.info("Firing dao_create_notification")
|
if notification.notification_type == NotificationType.SMS:
|
||||||
# dao_create_notification(notification)
|
redis_store.rpush(
|
||||||
current_app.logger.info(
|
"message_queue",
|
||||||
f"QUEUE LENTGH BEFOE {redis_store.llen("message_queue")}"
|
json.dumps(notification.serialize_for_redis(notification)),
|
||||||
)
|
)
|
||||||
redis_store.rpush(
|
else:
|
||||||
"message_queue", json.dumps(notification.serialize_for_redis(notification))
|
dao_create_notification(notification)
|
||||||
)
|
|
||||||
|
|
||||||
current_app.logger.info(
|
|
||||||
f"QUEUE LENTGH AFTA {redis_store.llen("message_queue")}"
|
|
||||||
)
|
|
||||||
return notification
|
return notification
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user