Rejigged the queue config.

- the two new queues that handle delivery of notifications (db-[type] / send-[type]) Now no longer are processed by the default workers
- These workers now to the admin type queues for notify (CSV/Validation codes) etc.
- Two new workers are deployed to the AWS environments, one focused on db- tasks and one for send tasks
- These will pick up those queues explicitly.
This commit is contained in:
Martyn Inglis
2016-08-31 11:40:31 +01:00
parent 668e6c9716
commit c108c493e6

View File

@@ -84,11 +84,7 @@ class Config(object):
CELERY_QUEUES = [
Queue('periodic', Exchange('default'), routing_key='periodic'),
Queue('sms', Exchange('default'), routing_key='sms'),
Queue('db-sms', Exchange('default'), routing_key='db-sms'),
Queue('send-sms', Exchange('default'), routing_key='send-sms'),
Queue('email', Exchange('default'), routing_key='email'),
Queue('db-email', Exchange('default'), routing_key='db-email'),
Queue('send-email', Exchange('default'), routing_key='send-email'),
Queue('sms-code', Exchange('default'), routing_key='sms-code'),
Queue('email-code', Exchange('default'), routing_key='email-code'),
Queue('email-reset-password', Exchange('default'), routing_key='email-reset-password'),
@@ -123,6 +119,25 @@ class Development(Config):
NOTIFY_ENVIRONMENT = 'development'
CSV_UPLOAD_BUCKET_NAME = 'development-notifications-csv-upload'
DEBUG = True
SQLALCHEMY_ECHO = False
CELERY_QUEUES = Config.CELERY_QUEUES + [
Queue('db-sms', Exchange('default'), routing_key='db-sms'),
Queue('send-sms', Exchange('default'), routing_key='send-sms'),
Queue('db-email', Exchange('default'), routing_key='db-email'),
Queue('send-email', Exchange('default'), routing_key='send-email')
]
class Test(Config):
NOTIFY_ENVIRONMENT = 'test'
CSV_UPLOAD_BUCKET_NAME = 'test-notifications-csv-upload'
STATSD_PREFIX = "test"
CELERY_QUEUES = Config.CELERY_QUEUES + [
Queue('db-sms', Exchange('default'), routing_key='db-sms'),
Queue('send-sms', Exchange('default'), routing_key='send-sms'),
Queue('db-email', Exchange('default'), routing_key='db-email'),
Queue('send-email', Exchange('default'), routing_key='send-email')
]
class Preview(Config):
@@ -131,12 +146,6 @@ class Preview(Config):
STATSD_PREFIX = "preview"
class Test(Development):
NOTIFY_ENVIRONMENT = 'test'
CSV_UPLOAD_BUCKET_NAME = 'test-notifications-csv-upload'
STATSD_PREFIX = "test"
class Staging(Config):
NOTIFY_ENVIRONMENT = 'staging'
CSV_UPLOAD_BUCKET_NAME = 'staging-notify-csv-upload'
@@ -147,15 +156,14 @@ class Staging(Config):
class Live(Config):
NOTIFY_ENVIRONMENT = 'live'
CSV_UPLOAD_BUCKET_NAME = 'live-notifications-csv-upload'
STATSD_ENABLED = True
STATSD_PREFIX = os.getenv('STATSD_PREFIX')
STATSD_ENABLED = True
configs = {
'development': Development,
'test': Test,
'live': Live,
'staging': Staging,
'preview': Preview
'development': Development(),
'test': Test(),
'live': Live(),
'staging': Staging(),
'preview': Preview()
}