fix: cap rate-limit backoff to daily ebay poll window

This commit is contained in:
DMleadgen 2026-04-10 16:19:30 -06:00
parent e2953a382b
commit c0914c92b4
Signed by: matt
GPG key ID: C2720CF8CD701894

View file

@ -184,7 +184,11 @@ function isRateLimitError(message: string): boolean {
}
function getBackoffMs(consecutiveFailures: number, rateLimited: boolean) {
const base = rateLimited ? 2 * BASE_REFRESH_MS : BASE_REFRESH_MS / 2
if (rateLimited) {
return BASE_REFRESH_MS
}
const base = BASE_REFRESH_MS / 2
const multiplier = Math.max(1, consecutiveFailures)
return Math.min(base * multiplier, MAX_BACKOFF_MS)
}