cube-studio/myapp/tasks/celery_app.py
2021-08-17 17:00:34 +08:00

18 lines
510 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Utility functions used across Myapp"""
# Myapp framework imports
from myapp import app
from myapp.utils.core import get_celery_app
# 全局配置全部celery app。所有任务都挂在这个app下面
conf = app.config
# print(conf)
# 获取CELERY_CONFIG中定义的任务配置这个是所有任务的统一配置项所有任务都应用这个配置项。
# 但这并不是真正的定义任务。因为任务是task修饰定义的。并且是有逻辑的
celery_app = get_celery_app(conf)