mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
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:
@@ -84,11 +84,7 @@ class Config(object):
|
|||||||
CELERY_QUEUES = [
|
CELERY_QUEUES = [
|
||||||
Queue('periodic', Exchange('default'), routing_key='periodic'),
|
Queue('periodic', Exchange('default'), routing_key='periodic'),
|
||||||
Queue('sms', Exchange('default'), routing_key='sms'),
|
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('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('sms-code', Exchange('default'), routing_key='sms-code'),
|
||||||
Queue('email-code', Exchange('default'), routing_key='email-code'),
|
Queue('email-code', Exchange('default'), routing_key='email-code'),
|
||||||
Queue('email-reset-password', Exchange('default'), routing_key='email-reset-password'),
|
Queue('email-reset-password', Exchange('default'), routing_key='email-reset-password'),
|
||||||
@@ -123,6 +119,25 @@ class Development(Config):
|
|||||||
NOTIFY_ENVIRONMENT = 'development'
|
NOTIFY_ENVIRONMENT = 'development'
|
||||||
CSV_UPLOAD_BUCKET_NAME = 'development-notifications-csv-upload'
|
CSV_UPLOAD_BUCKET_NAME = 'development-notifications-csv-upload'
|
||||||
DEBUG = True
|
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):
|
class Preview(Config):
|
||||||
@@ -131,12 +146,6 @@ class Preview(Config):
|
|||||||
STATSD_PREFIX = "preview"
|
STATSD_PREFIX = "preview"
|
||||||
|
|
||||||
|
|
||||||
class Test(Development):
|
|
||||||
NOTIFY_ENVIRONMENT = 'test'
|
|
||||||
CSV_UPLOAD_BUCKET_NAME = 'test-notifications-csv-upload'
|
|
||||||
STATSD_PREFIX = "test"
|
|
||||||
|
|
||||||
|
|
||||||
class Staging(Config):
|
class Staging(Config):
|
||||||
NOTIFY_ENVIRONMENT = 'staging'
|
NOTIFY_ENVIRONMENT = 'staging'
|
||||||
CSV_UPLOAD_BUCKET_NAME = 'staging-notify-csv-upload'
|
CSV_UPLOAD_BUCKET_NAME = 'staging-notify-csv-upload'
|
||||||
@@ -147,15 +156,14 @@ class Staging(Config):
|
|||||||
class Live(Config):
|
class Live(Config):
|
||||||
NOTIFY_ENVIRONMENT = 'live'
|
NOTIFY_ENVIRONMENT = 'live'
|
||||||
CSV_UPLOAD_BUCKET_NAME = 'live-notifications-csv-upload'
|
CSV_UPLOAD_BUCKET_NAME = 'live-notifications-csv-upload'
|
||||||
STATSD_ENABLED = True
|
|
||||||
STATSD_PREFIX = os.getenv('STATSD_PREFIX')
|
STATSD_PREFIX = os.getenv('STATSD_PREFIX')
|
||||||
STATSD_ENABLED = True
|
STATSD_ENABLED = True
|
||||||
|
|
||||||
|
|
||||||
configs = {
|
configs = {
|
||||||
'development': Development,
|
'development': Development(),
|
||||||
'test': Test,
|
'test': Test(),
|
||||||
'live': Live,
|
'live': Live(),
|
||||||
'staging': Staging,
|
'staging': Staging(),
|
||||||
'preview': Preview
|
'preview': Preview()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user