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)
|
CELERY_BROKER_VHOST)
|
||||||
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
|
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
|
||||||
|
|
||||||
BROKER_TRANSPORT_OPTIONS = {
|
try:
|
||||||
'fanout_patterns': True,
|
BROKER_TRANSPORT_OPTIONS = {
|
||||||
'fanout_prefix': True,
|
'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
|
# Message expiry time in seconds
|
||||||
CELERY_EVENT_QUEUE_TTL = ENV_TOKENS.get('CELERY_EVENT_QUEUE_TTL', None)
|
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)
|
CELERY_BROKER_VHOST)
|
||||||
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
|
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
|
||||||
|
|
||||||
BROKER_TRANSPORT_OPTIONS = {
|
try:
|
||||||
'fanout_patterns': True,
|
BROKER_TRANSPORT_OPTIONS = {
|
||||||
'fanout_prefix': True,
|
'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
|
# Block Structures
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user