__init__.py 文件源码

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

项目:twopi-flask-utils 作者: TwoPiCode 项目源码 文件源码
def create_celery(name, config_obj, inject_version=True, **kwargs):
    """Creates a celery app.

    :param config_obj: The configuration object to initiaze with
    :param inject_version: bool: Whether or not to inject the application's
                                 version number. Attempts to get version number
                                using 
                                :func:`twopi_flask_utils.deployment_release.get_release`
    :param kwargs: Other arguments to pass to the ``Celery`` instantiation.
    :returns: An initialized celery application.
    """

    celery = Celery(name, broker=config_obj.CELERY_BROKER_URL, **kwargs)
    celery.config_from_object(config_obj)
    if inject_version:
        celery.version = get_release()

    return celery
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号