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)
setup_celery.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录