mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
When using a priority template put the notification in the priority queue.
- there is now a dedicated worker to handle priority queues. We don't now bundle this in the default worker.
This commit is contained in:
@@ -131,7 +131,7 @@ def send_notification(notification_type):
|
|||||||
key_type=api_user.key_type,
|
key_type=api_user.key_type,
|
||||||
simulated=simulated)
|
simulated=simulated)
|
||||||
if not simulated:
|
if not simulated:
|
||||||
queue_name = 'notify' if template.process_type == PRIORITY else None
|
queue_name = 'priority' if template.process_type == PRIORITY else None
|
||||||
send_notification_to_queue(notification=notification_model,
|
send_notification_to_queue(notification=notification_model,
|
||||||
research_mode=service.research_mode,
|
research_mode=service.research_mode,
|
||||||
queue=queue_name)
|
queue=queue_name)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def post_notification(notification_type):
|
|||||||
reference=form.get('reference', None),
|
reference=form.get('reference', None),
|
||||||
simulated=simulated)
|
simulated=simulated)
|
||||||
if not simulated:
|
if not simulated:
|
||||||
queue_name = 'notify' if template.process_type == PRIORITY else None
|
queue_name = 'priority' if template.process_type == PRIORITY else None
|
||||||
send_notification_to_queue(notification=notification, research_mode=service.research_mode, queue=queue_name)
|
send_notification_to_queue(notification=notification, research_mode=service.research_mode, queue=queue_name)
|
||||||
else:
|
else:
|
||||||
current_app.logger.info("POST simulated notification for id: {}".format(notification.id))
|
current_app.logger.info("POST simulated notification for id: {}".format(notification.id))
|
||||||
|
|||||||
@@ -1022,4 +1022,4 @@ def test_send_notification_uses_priority_queue_when_template_is_marked_as_priori
|
|||||||
notification_id = response_data['notification']['id']
|
notification_id = response_data['notification']['id']
|
||||||
|
|
||||||
assert response.status_code == 201
|
assert response.status_code == 201
|
||||||
mocked.assert_called_once_with([notification_id], queue='notify')
|
mocked.assert_called_once_with([notification_id], queue='priority')
|
||||||
|
|||||||
@@ -223,4 +223,4 @@ def test_send_notification_uses_priority_queue_when_template_is_marked_as_priori
|
|||||||
notification_id = json.loads(response.data)['id']
|
notification_id = json.loads(response.data)['id']
|
||||||
|
|
||||||
assert response.status_code == 201
|
assert response.status_code == 201
|
||||||
mocked.assert_called_once_with([notification_id], queue='notify')
|
mocked.assert_called_once_with([notification_id], queue='priority')
|
||||||
|
|||||||
Reference in New Issue
Block a user