gsewa.py 文件源码

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

项目:gSewa 作者: RazinDangol 项目源码 文件源码
def make_celery(app):
    celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'])
    celery.conf.update(app.config)
    TaskBase = celery.Task

    class ContextTask(TaskBase):
        abstract = True

        def __call__(self, *args, **kwargs):
            with app.app_context():
                return TaskBase.__call__(self, *args, **kwargs)
    celery.Task = ContextTask
    return celery



# Making SqlAlchemy instance of the app
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号