fix: skip rate limiting when custom error codes don't match upstream status
Add ShouldHandleErrorCode guard at the entry of handleGeminiUpstreamError and AntigravityGatewayService.handleUpstreamError so that accounts with custom error codes (e.g. [599]) are not rate-limited when the upstream returns a non-matching status (e.g. 429).
This commit is contained in:
@@ -2243,6 +2243,10 @@ func (s *AntigravityGatewayService) handleUpstreamError(
|
||||
requestedModel string,
|
||||
groupID int64, sessionHash string, isStickySession bool,
|
||||
) *handleModelRateLimitResult {
|
||||
// 遵守自定义错误码策略:未命中则跳过所有限流处理
|
||||
if !account.ShouldHandleErrorCode(statusCode) {
|
||||
return nil
|
||||
}
|
||||
// 模型级限流处理(优先)
|
||||
result := s.handleModelRateLimit(&handleModelRateLimitParams{
|
||||
ctx: ctx,
|
||||
|
||||
Reference in New Issue
Block a user