feat: add linear delay between Antigravity account failover switches

This commit is contained in:
erio
2026-02-09 06:56:29 +08:00
parent a67d9337b8
commit 681950dadd
2 changed files with 30 additions and 0 deletions

View File

@@ -433,6 +433,11 @@ func (h *GatewayHandler) GeminiV1BetaModels(c *gin.Context) {
lastFailoverErr = failoverErr
switchCount++
log.Printf("Gemini account %d: upstream error %d, switching account %d/%d", account.ID, failoverErr.StatusCode, switchCount, maxAccountSwitches)
if account.Platform == service.PlatformAntigravity {
if !sleepFailoverDelay(c.Request.Context(), switchCount) {
return
}
}
continue
}
// ForwardNative already wrote the response