From 46e03683ce668082f10ad914a0cf0e67bf8d43e1 Mon Sep 17 00:00:00 2001 From: CalciumIon <1808837298@qq.com> Date: Sat, 24 Aug 2024 17:27:14 +0800 Subject: [PATCH] fix: channel auto ban --- controller/relay.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/relay.go b/controller/relay.go index 13fbde0f5..875222dd8 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -121,6 +121,9 @@ func shouldRetry(c *gin.Context, openaiErr *dto.OpenAIErrorWithStatusCode, retry if openaiErr == nil { return false } + if openaiErr.LocalError { + return false + } if retryTimes <= 0 { return false } @@ -151,9 +154,6 @@ func shouldRetry(c *gin.Context, openaiErr *dto.OpenAIErrorWithStatusCode, retry // azure处理超时不重试 return false } - if openaiErr.LocalError { - return false - } if openaiErr.StatusCode/100 == 2 { return false }