celery.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:websauna 作者: websauna 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号