测试通过
This commit is contained in:
@@ -44,17 +44,14 @@ API_CONFIG = {
|
|||||||
|
|
||||||
API_CONFIG = {
|
API_CONFIG = {
|
||||||
'task_test': {
|
'task_test': {
|
||||||
'url': 'https://httpbin.org/post',
|
'url': 'http://localhost:8000/health',
|
||||||
'method': 'POST',
|
'method': 'GET',
|
||||||
'headers': {
|
'headers': {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'User-Agent': 'Celery-Task/1.0'
|
'User-Agent': 'Celery-Task/1.0'
|
||||||
},
|
},
|
||||||
'timeout': 30,
|
'timeout': 30,
|
||||||
'body': {
|
'body': {
|
||||||
'test': 'data',
|
|
||||||
'timestamp': '2025-12-11T10:00:00Z',
|
|
||||||
'source': 'api_config_test'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,9 +290,6 @@ def execute_call_api_task(self):
|
|||||||
# 从环境变量获取Authorization并添加到headers
|
# 从环境变量获取Authorization并添加到headers
|
||||||
if settings.api_authorization_token:
|
if settings.api_authorization_token:
|
||||||
headers['Authorization'] = settings.api_authorization_token
|
headers['Authorization'] = settings.api_authorization_token
|
||||||
else:
|
|
||||||
logger.warning(f"⚠️ API Authorization Token 未配置,跳过API调用: {api_key}")
|
|
||||||
continue
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logger.info(f"正在调用任务API: {method} {call_url}")
|
logger.info(f"正在调用任务API: {method} {call_url}")
|
||||||
|
|||||||
Reference in New Issue
Block a user