mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-11 00:23:42 +08:00
feat: 超时状态码不重试
This commit is contained in:
@@ -93,6 +93,10 @@ func shouldRetry(c *gin.Context, channelId int, openaiErr *dto.OpenAIErrorWithSt
|
||||
return true
|
||||
}
|
||||
if openaiErr.StatusCode/100 == 5 {
|
||||
// 超时不重试
|
||||
if openaiErr.StatusCode == 504 || openaiErr.StatusCode == 524 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
if openaiErr.StatusCode == http.StatusBadRequest {
|
||||
|
||||
Reference in New Issue
Block a user