feat: adds CELERY_BROKER_TRANSPORT_OPTIONS (#28849)
which can be configured from the lms/studio environment refactor: raise ImproperlyConfigured on TypeError Signed-off-by: Gabor Boros <gabor.brs@gmail.com> Co-authored-by: Jillian Vogel <jill@opencraft.com>
This commit is contained in:
@@ -402,10 +402,14 @@ BROKER_URL = "{}://{}:{}@{}/{}".format(CELERY_BROKER_TRANSPORT,
|
||||
CELERY_BROKER_VHOST)
|
||||
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
|
||||
|
||||
BROKER_TRANSPORT_OPTIONS = {
|
||||
'fanout_patterns': True,
|
||||
'fanout_prefix': True,
|
||||
}
|
||||
try:
|
||||
BROKER_TRANSPORT_OPTIONS = {
|
||||
'fanout_patterns': True,
|
||||
'fanout_prefix': True,
|
||||
**ENV_TOKENS.get('CELERY_BROKER_TRANSPORT_OPTIONS', {})
|
||||
}
|
||||
except TypeError as exc:
|
||||
raise ImproperlyConfigured('CELERY_BROKER_TRANSPORT_OPTIONS must be a dict') from exc
|
||||
|
||||
# Message expiry time in seconds
|
||||
CELERY_EVENT_QUEUE_TTL = ENV_TOKENS.get('CELERY_EVENT_QUEUE_TTL', None)
|
||||
|
||||
@@ -524,10 +524,14 @@ BROKER_URL = "{}://{}:{}@{}/{}".format(CELERY_BROKER_TRANSPORT,
|
||||
CELERY_BROKER_VHOST)
|
||||
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
|
||||
|
||||
BROKER_TRANSPORT_OPTIONS = {
|
||||
'fanout_patterns': True,
|
||||
'fanout_prefix': True,
|
||||
}
|
||||
try:
|
||||
BROKER_TRANSPORT_OPTIONS = {
|
||||
'fanout_patterns': True,
|
||||
'fanout_prefix': True,
|
||||
**ENV_TOKENS.get('CELERY_BROKER_TRANSPORT_OPTIONS', {})
|
||||
}
|
||||
except TypeError as exc:
|
||||
raise ImproperlyConfigured('CELERY_BROKER_TRANSPORT_OPTIONS must be a dict') from exc
|
||||
|
||||
# Block Structures
|
||||
|
||||
|
||||
Reference in New Issue
Block a user