mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(rate-limit): raise wedge threshold from 5s to 120s
Addresses gemini-code-assist review on #1828: at 5s, the watchdog can false-trigger on a healthy limiter that's correctly waiting on its reservoir refresh (60s default) or adaptive minTime (up to ~60s for 1-RPM providers). 120s gives a 2× margin against both while still catching the actual wedge case (observed at 3+ minutes stalled). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,12 @@ let currentRequestQueueSettings: RequestQueueSettings = DEFAULT_RESILIENCE_SETTI
|
||||
const lastDispatchAt = new Map<string, number>();
|
||||
let watchdogInterval: ReturnType<typeof setInterval> | null = null;
|
||||
const WATCHDOG_INTERVAL_MS = 30_000;
|
||||
const WEDGE_THRESHOLD_MS = 5_000;
|
||||
// Threshold has to exceed any *legitimate* gap between dispatches:
|
||||
// - default reservoirRefreshInterval is 60s
|
||||
// - adaptive minTime can climb to ~60s for 1-RPM providers (see updateFromHeaders)
|
||||
// 120s gives a 2× margin against both, while still catching the actual wedge
|
||||
// case we observed (queue stalled for 3+ minutes with no progress).
|
||||
const WEDGE_THRESHOLD_MS = 120_000;
|
||||
|
||||
/**
|
||||
* Env-var override for the auto-enable safety net. Highest priority — wins
|
||||
|
||||
Reference in New Issue
Block a user