If the template.process_type = PRIROITY send the message to the notify queue.

We are using the notify queue in this iteration because that queue is a low volume queue with it's own dedicated workers. This just saves us from building a new queue at this point, and a new queue may not be necessary.
This commit is contained in:
Rebecca Law
2017-01-17 13:16:26 +00:00
parent a8cdabcecd
commit b34c5f0bcd
5 changed files with 145 additions and 89 deletions

View File

@@ -3,7 +3,7 @@ from sqlalchemy.orm.exc import NoResultFound
from app import api_user
from app.dao import services_dao, templates_dao
from app.models import SMS_TYPE, EMAIL_TYPE
from app.models import SMS_TYPE, EMAIL_TYPE, PRIORITY
from app.notifications.process_notifications import (create_content_for_notification,
persist_notification,
send_notification_to_queue,
@@ -50,7 +50,8 @@ def post_notification(notification_type):
reference=form.get('reference', None),
simulated=simulated)
if not simulated:
send_notification_to_queue(notification, service.research_mode)
queue_name = 'notify' if template.process_type == PRIORITY else None
send_notification_to_queue(notification=notification, research_mode=service.research_mode, queue=queue_name)
else:
current_app.logger.info("POST simulated notification for id: {}".format(notification.id))
if notification_type == SMS_TYPE: