setup_celery.py 文件源码

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

项目:fabric8-analytics-worker 作者: fabric8-analytics 项目源码 文件源码
def init_celery(app=None, result_backend=True):
    """Init Celery configuration.

    :param app: celery configuration, if omitted, application will be instantiated
    :param result_backend: True if Celery should connect to result backend
    """
    # Keep this for debugging purposes for now
    _logger.debug(">>> Selinon version is %s" % selinon_version)
    _logger.debug(">>> Selinonlib version is %s" % selinonlib_version)
    _logger.debug(">>> Celery version is %s" % celery_version)

    if not result_backend:
        CelerySettings.disable_result_backend()

    if app is None:
        app = Celery('tasks')
        app.config_from_object(CelerySettings)
    else:
        app.config_from_object(CelerySettings)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号