Files
task-executer/api_config.py
2025-12-09 15:59:58 +08:00

27 lines
645 B
Python

"""API接口配置文件"""
# API配置
API_CONFIG = {
'put_api': {
'url': 'https://jsonplaceholder.typicode.com/posts/1',
'method': 'PUT',
'headers': {
'Content-Type': 'application/json',
'User-Agent': 'Celery-Task/1.0'
},
'timeout': 30,
'body': {
'id': 1,
'title': '更新后的标题',
'body': '这是通过PUT请求更新的内容',
'userId': 1
}
}
}
# 重试配置
RETRY_CONFIG = {
'max_retries': 3,
'retry_delay': 60, # 重试间隔(秒)
'retry_on_status': [500, 502, 503, 504, 429]
}