调接口的任务改为每天上午9点执行一次
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# API配置
|
||||
API_CONFIG = {
|
||||
# 关闭清洗任务
|
||||
'task_01': {
|
||||
'task_1': {
|
||||
'url': 'http://agent-api.ai.telrobot.top/agent-api/new/user/8f6bae44-e02a-4393-a6cf-adb861bf7d8c/task_start/a3bdd5b6-1932-4bc9-95bf-dbc4bccb171f',
|
||||
'method': 'PUT',
|
||||
'headers': {
|
||||
@@ -16,7 +16,7 @@ API_CONFIG = {
|
||||
}
|
||||
},
|
||||
# Ice跟进
|
||||
'task_01': {
|
||||
'task_2': {
|
||||
'url': 'http://agent-api.ai.telrobot.top/agent-api/new/user/8f6bae44-e02a-4393-a6cf-adb861bf7d8c/task_start/db17ba5f-666a-4dc0-a635-1d4d0059338d',
|
||||
'method': 'PUT',
|
||||
'headers': {
|
||||
@@ -29,7 +29,7 @@ API_CONFIG = {
|
||||
}
|
||||
},
|
||||
# 战败清洗跟进
|
||||
'task_01': {
|
||||
'task_3': {
|
||||
'url': 'http://agent-api.ai.telrobot.top/agent-api/new/user/8f6bae44-e02a-4393-a6cf-adb861bf7d8c/task_start/2121d91e-c7d8-47cf-8a67-fa2f22e087ae',
|
||||
'method': 'PUT',
|
||||
'headers': {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Celery应用配置
|
||||
"""
|
||||
from celery import Celery
|
||||
from celery.schedules import crontab
|
||||
from app.config import settings
|
||||
from app.logger import get_celery_logger
|
||||
|
||||
@@ -36,7 +37,7 @@ celery_app.conf.update(
|
||||
},
|
||||
'daily-morning-task': {
|
||||
'task': 'call_api',
|
||||
'schedule': '120.0'
|
||||
'schedule': crontab(hour=9, minute=0) # 每天上午9点执行
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -225,7 +225,7 @@ def push_data_to_dtc_task(self):
|
||||
def execute_call_api_task(self):
|
||||
"""遍历API配置文件中的所有API信息并调用接口"""
|
||||
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
logger.info(f"开始遍历API配置文件执行调用任务 - 当前时间: {current_time}")
|
||||
logger.info(f"开始遍历API配置文件执行任务 - 当前时间: {current_time}")
|
||||
|
||||
# 获取重试配置
|
||||
max_retries = RETRY_CONFIG['max_retries']
|
||||
@@ -331,7 +331,6 @@ def execute_call_api_task(self):
|
||||
|
||||
# 汇总结果
|
||||
total_count = len(results)
|
||||
logger.info(f"遍历API配置文件完成 - 成功: {success_count}/{total_count}")
|
||||
print(f"[{current_time}] 📊 任务汇总 - 成功: {success_count}/{total_count}")
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user