fix(antigravity): reduce 429 fallback cooldown from 5min to 30s
The default fallback cooldown when rate limit reset time cannot be parsed was 5 minutes, which is too aggressive and causes accounts to be unnecessarily locked out. Reduce to 30 seconds for faster recovery. Config override still works (unit remains minutes).
This commit is contained in:
@@ -2048,11 +2048,12 @@ func (s *AntigravityGatewayService) handleUpstreamError(ctx context.Context, pre
|
||||
resetAt := ParseGeminiRateLimitResetTime(body)
|
||||
if resetAt == nil {
|
||||
// 解析失败:使用配置的 fallback 时间,直接限流整个账户
|
||||
fallbackMinutes := 5
|
||||
// 默认 30 秒,可通过配置覆盖(配置单位为分钟)
|
||||
fallbackSeconds := 30
|
||||
if s.settingService != nil && s.settingService.cfg != nil && s.settingService.cfg.Gateway.AntigravityFallbackCooldownMinutes > 0 {
|
||||
fallbackMinutes = s.settingService.cfg.Gateway.AntigravityFallbackCooldownMinutes
|
||||
fallbackSeconds = s.settingService.cfg.Gateway.AntigravityFallbackCooldownMinutes * 60
|
||||
}
|
||||
defaultDur := time.Duration(fallbackMinutes) * time.Minute
|
||||
defaultDur := time.Duration(fallbackSeconds) * time.Second
|
||||
if fallbackDur, ok := antigravityFallbackCooldownSeconds(); ok {
|
||||
defaultDur = fallbackDur
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user