From 3fbbf1285cbf57f64a015068003b78a750bf2e1d Mon Sep 17 00:00:00 2001 From: "mark.tian" Date: Wed, 10 Dec 2025 08:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=A4=96=E5=91=BCtask?= =?UTF-8?q?=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 3 --- app/celery_tasks.py | 2 +- app/config.py | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.env.example b/.env.example index c43e467..e72e6d6 100644 --- a/.env.example +++ b/.env.example @@ -5,9 +5,6 @@ DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/ai_talk_callback_ CELERY_BROKER_URL=redis://localhost:6379/0 CELERY_RESULT_BACKEND=redis://localhost:6379/0 -# 任务配置 -TASK_ENABLED=true - # Flower监控配置 FLOWER_ENABLED=true FLOWER_PORT=5555 diff --git a/app/celery_tasks.py b/app/celery_tasks.py index 6e503aa..dda6fa3 100644 --- a/app/celery_tasks.py +++ b/app/celery_tasks.py @@ -41,7 +41,6 @@ engine = create_engine( ) @celery_app.task(bind=True, name='push_data_to_dtc') -@conditional_task(enabled=settings.task_enabled) def push_data_to_dtc_task(self): """ 推送数据给DTC的Celery任务 @@ -222,6 +221,7 @@ def push_data_to_dtc_task(self): @celery_app.task(bind=True, name='call_api', max_retries=None) +@conditional_task(enabled=False) def execute_call_api_task(self): """遍历API配置文件中的所有API信息并调用接口""" current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') diff --git a/app/config.py b/app/config.py index 10fd561..39d2dcd 100644 --- a/app/config.py +++ b/app/config.py @@ -18,9 +18,6 @@ class Settings(BaseSettings): celery_timezone: str = "Asia/Shanghai" celery_enable_utc: bool = False - # 任务配置 - task_enabled: bool = False # 是否启用任务 - # Flower监控配置 flower_enabled: bool = True # 是否启用Flower监控 flower_url: str = "http://localhost:5555" # Flower访问URL