We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7967c67 commit ccb75bdCopy full SHA for ccb75bd
1 file changed
src/api/utils.py
@@ -79,7 +79,8 @@ async def handle_error_with_retry(
79
仅在以下情况下进行自动重试:
80
1. 429错误(速率限制)
81
2. 503错误(服务不可用)
82
- 3. 导致凭证封禁的错误(AUTO_BAN_ERROR_CODES配置)
+ 3. 500错误(服务临时不可用)
83
+ 4. 导致凭证封禁的错误(AUTO_BAN_ERROR_CODES配置)
84
85
Args:
86
credential_manager: 凭证管理器实例
@@ -111,8 +112,8 @@ async def handle_error_with_retry(
111
112
return True
113
return False
114
- # 如果不触发自动封禁,仅对429和503错误进行重试
115
- if (status_code == 429 or status_code == 503) and retry_enabled and attempt < max_retries:
+ # 如果不触发自动封禁,仅对429、503和500错误进行重试
116
+ if status_code in (429, 500, 503) and retry_enabled and attempt < max_retries:
117
log.info(
118
f"[{mode.upper()} RETRY] {status_code} error encountered, retrying "
119
f"(attempt {attempt + 1}/{max_retries})"
0 commit comments