From 07b527bb1bf95ed98370026319580cf5feef9151 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Wed, 24 May 2017 15:47:20 +0100 Subject: [PATCH] All queues now managed in the same way: - TEST and DEV builds set up their own queue lists for reading - PROD/STAGE/PREVIEW use the separate worker process with the -Q flag This enables us to rename queues in due course --- app/config.py | 16 +++++++++------- manifest-delivery-base.yml | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/config.py b/app/config.py index 53e92912e..1d845b508 100644 --- a/app/config.py +++ b/app/config.py @@ -160,11 +160,7 @@ class Config(object): 'options': {'queue': 'periodic'} } } - CELERY_QUEUES = [ - Queue('process-job', Exchange('default'), routing_key='process-job'), - Queue('retry', Exchange('default'), routing_key='retry'), - Queue('notify', Exchange('default'), routing_key='notify') - ] + CELERY_QUEUES = [] NOTIFICATIONS_ALERT = 5 # five mins FROM_NUMBER = 'development' @@ -224,7 +220,10 @@ class Development(Config): Queue('send-sms', Exchange('default'), routing_key='send-sms'), Queue('send-email', Exchange('default'), routing_key='send-email'), Queue('research-mode', Exchange('default'), routing_key='research-mode'), - Queue('statistics', Exchange('default'), routing_key='statistics') + Queue('statistics', Exchange('default'), routing_key='statistics'), + Queue('process-job', Exchange('default'), routing_key='process-job'), + Queue('retry', Exchange('default'), routing_key='retry'), + Queue('notify', Exchange('default'), routing_key='notify') ] API_HOST_NAME = "http://localhost:6011" API_RATE_LIMIT_ENABLED = True @@ -248,7 +247,10 @@ class Test(Config): Queue('send-sms', Exchange('default'), routing_key='send-sms'), Queue('send-email', Exchange('default'), routing_key='send-email'), Queue('research-mode', Exchange('default'), routing_key='research-mode'), - Queue('statistics', Exchange('default'), routing_key='statistics') + Queue('statistics', Exchange('default'), routing_key='statistics'), + Queue('process-job', Exchange('default'), routing_key='process-job'), + Queue('retry', Exchange('default'), routing_key='retry'), + Queue('notify', Exchange('default'), routing_key='notify') ] API_RATE_LIMIT_ENABLED = True diff --git a/manifest-delivery-base.yml b/manifest-delivery-base.yml index 73457b3c9..f3c196272 100644 --- a/manifest-delivery-base.yml +++ b/manifest-delivery-base.yml @@ -50,6 +50,6 @@ applications: NOTIFY_APP_NAME: delivery-worker-priority - name: notify-delivery-worker - command: scripts/run_app_paas.sh celery -A aws_run_celery.notify_celery worker --loglevel=INFO --concurrency=11 + command: scripts/run_app_paas.sh celery -A aws_run_celery.notify_celery worker --loglevel=INFO --concurrency=11 -Q process-job,notify,retry env: NOTIFY_APP_NAME: delivery-worker