merge upstream

Signed-off-by: wozulong <>
This commit is contained in:
wozulong
2024-04-10 11:31:20 +08:00
12 changed files with 177 additions and 94 deletions

View File

@@ -92,6 +92,9 @@ func shouldRetry(c *gin.Context, channelId int, openaiErr *dto.OpenAIErrorWithSt
if openaiErr.StatusCode == http.StatusTooManyRequests {
return true
}
if openaiErr.StatusCode == 307 {
return true
}
if openaiErr.StatusCode/100 == 5 {
// 超时不重试
if openaiErr.StatusCode == 504 || openaiErr.StatusCode == 524 {