def get_celery_config(registry: Registry) -> dict:
"""Load Celery configuration from settings.
You need to have a setting key ``celery_config_python``. This is Python code to configure Celery. The code is executed and all locals are passed to Celery app.
More information:
* http://docs.celeryproject.org/en/master/userguide/configuration.html
:param registry: Pyramid registry from where we read the Celery configuratino
:return: An object holding Celery configuration variables
"""
celery_config_python = registry.settings.get('websauna.celery_config')
if not celery_config_python:
raise RuntimeError('Using Celery with Websauna requires you to have celery_config_python configuration variable')
return parse_celery_config(celery_config_python)
评论列表
文章目录