From 29b6a918e829ec78bebaca972f60d7e03a763213 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Thu, 25 May 2017 13:43:31 +0100 Subject: [PATCH] Ensure dev and test builds will read from old and new queues --- app/config.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/config.py b/app/config.py index b3ec9fe5f..76917b79c 100644 --- a/app/config.py +++ b/app/config.py @@ -24,6 +24,23 @@ class QueueNames(object): NOTIFY = 'notify-internal-tasks' PROCESS_FTP = 'process-ftp-tasks' + @staticmethod + def old_queues(): + return [ + 'db-sms', + 'db-email', + 'db-letter', + 'priority', + 'periodic', + 'send-sms', + 'send-email', + 'research-mode', + 'statistics', + 'notify', + 'retry', + 'process-job' + ] + @staticmethod def all_queues(): return [ @@ -240,6 +257,8 @@ class Development(Config): NOTIFICATION_QUEUE_PREFIX = 'development' DEBUG = True + queues = QueueNames.all_queues() + QueueNames.old_queues() + for queue in QueueNames.all_queues(): Config.CELERY_QUEUES.append( Queue(queue, Exchange('default'), routing_key=queue) @@ -259,7 +278,9 @@ class Test(Config): STATSD_HOST = "localhost" STATSD_PORT = 1000 - for queue in QueueNames.all_queues(): + queues = QueueNames.all_queues() + QueueNames.old_queues() + + for queue in queues: Config.CELERY_QUEUES.append( Queue(queue, Exchange('default'), routing_key=queue) )