给每个定时任务增加一个开关
This commit is contained in:
@@ -41,6 +41,7 @@ engine = create_engine(
|
||||
)
|
||||
|
||||
@celery_app.task(bind=True, name='push_data_to_dtc')
|
||||
@conditional_task(enabled=settings.enabled_push_data_to_dtc_task)
|
||||
def push_data_to_dtc_task(self):
|
||||
"""
|
||||
推送数据给DTC的Celery任务
|
||||
@@ -221,7 +222,7 @@ def push_data_to_dtc_task(self):
|
||||
|
||||
|
||||
@celery_app.task(bind=True, name='call_api', max_retries=None)
|
||||
@conditional_task(enabled=False)
|
||||
@conditional_task(enabled=settings.enabled_call_api_task)
|
||||
def execute_call_api_task(self):
|
||||
"""遍历API配置文件中的所有API信息并调用接口"""
|
||||
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
Reference in New Issue
Block a user