mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
add separate send-sms and send-email queues
we're reading from those two queues as well as teh existing send queue, however for now we don't send anything to them
This commit is contained in:
@@ -182,7 +182,7 @@ def send_sms(self,
|
|||||||
|
|
||||||
provider_tasks.deliver_sms.apply_async(
|
provider_tasks.deliver_sms.apply_async(
|
||||||
[str(saved_notification.id)],
|
[str(saved_notification.id)],
|
||||||
queue=QueueNames.SEND if not service.research_mode else QueueNames.RESEARCH_MODE
|
queue=QueueNames.SEND_COMBINED if not service.research_mode else QueueNames.RESEARCH_MODE
|
||||||
)
|
)
|
||||||
|
|
||||||
current_app.logger.info(
|
current_app.logger.info(
|
||||||
@@ -227,7 +227,7 @@ def send_email(self,
|
|||||||
|
|
||||||
provider_tasks.deliver_email.apply_async(
|
provider_tasks.deliver_email.apply_async(
|
||||||
[str(saved_notification.id)],
|
[str(saved_notification.id)],
|
||||||
queue=QueueNames.SEND if not service.research_mode else QueueNames.RESEARCH_MODE
|
queue=QueueNames.SEND_COMBINED if not service.research_mode else QueueNames.RESEARCH_MODE
|
||||||
)
|
)
|
||||||
|
|
||||||
current_app.logger.info("Email {} created at {}".format(saved_notification.id, created_at))
|
current_app.logger.info("Email {} created at {}".format(saved_notification.id, created_at))
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ class QueueNames(object):
|
|||||||
PERIODIC = 'periodic-tasks'
|
PERIODIC = 'periodic-tasks'
|
||||||
PRIORITY = 'priority-tasks'
|
PRIORITY = 'priority-tasks'
|
||||||
DATABASE = 'database-tasks'
|
DATABASE = 'database-tasks'
|
||||||
SEND = 'send-tasks'
|
SEND_COMBINED = 'send-tasks'
|
||||||
|
SEND_SMS = 'send-sms-tasks'
|
||||||
|
SEND_EMAIL = 'send-email-tasks'
|
||||||
RESEARCH_MODE = 'research-mode-tasks'
|
RESEARCH_MODE = 'research-mode-tasks'
|
||||||
STATISTICS = 'statistics-tasks'
|
STATISTICS = 'statistics-tasks'
|
||||||
JOBS = 'job-tasks'
|
JOBS = 'job-tasks'
|
||||||
@@ -36,7 +38,9 @@ class QueueNames(object):
|
|||||||
QueueNames.PRIORITY,
|
QueueNames.PRIORITY,
|
||||||
QueueNames.PERIODIC,
|
QueueNames.PERIODIC,
|
||||||
QueueNames.DATABASE,
|
QueueNames.DATABASE,
|
||||||
QueueNames.SEND,
|
QueueNames.SEND_COMBINED,
|
||||||
|
QueueNames.SEND_SMS,
|
||||||
|
QueueNames.SEND_EMAIL,
|
||||||
QueueNames.RESEARCH_MODE,
|
QueueNames.RESEARCH_MODE,
|
||||||
QueueNames.STATISTICS,
|
QueueNames.STATISTICS,
|
||||||
QueueNames.JOBS,
|
QueueNames.JOBS,
|
||||||
|
|||||||
@@ -42,4 +42,4 @@ def send_response(send_call, task_call, notification):
|
|||||||
notification.id,
|
notification.id,
|
||||||
notification.notification_type),
|
notification.notification_type),
|
||||||
e)
|
e)
|
||||||
task_call.apply_async((str(notification.id)), queue=QueueNames.SEND)
|
task_call.apply_async((str(notification.id)), queue=QueueNames.SEND_COMBINED)
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ def send_notification_to_queue(notification, research_mode, queue=None):
|
|||||||
if research_mode or notification.key_type == KEY_TYPE_TEST:
|
if research_mode or notification.key_type == KEY_TYPE_TEST:
|
||||||
queue = QueueNames.RESEARCH_MODE
|
queue = QueueNames.RESEARCH_MODE
|
||||||
elif not queue:
|
elif not queue:
|
||||||
queue = QueueNames.SEND
|
queue = QueueNames.SEND_COMBINED
|
||||||
|
|
||||||
if notification.notification_type == SMS_TYPE:
|
if notification.notification_type == SMS_TYPE:
|
||||||
deliver_task = provider_tasks.deliver_sms
|
deliver_task = provider_tasks.deliver_sms
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ applications:
|
|||||||
NOTIFY_APP_NAME: delivery-worker-research
|
NOTIFY_APP_NAME: delivery-worker-research
|
||||||
|
|
||||||
- name: notify-delivery-worker-sender
|
- name: notify-delivery-worker-sender
|
||||||
command: scripts/run_app_paas.sh celery -A aws_run_celery.notify_celery worker --loglevel=INFO --concurrency=11 -Q send-tasks
|
command: scripts/run_app_paas.sh celery -A aws_run_celery.notify_celery worker --loglevel=INFO --concurrency=11 -Q send-tasks,send-sms-tasks,send-email-tasks
|
||||||
env:
|
env:
|
||||||
NOTIFY_APP_NAME: delivery-worker-sender
|
NOTIFY_APP_NAME: delivery-worker-sender
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user