fix(carcatonline): varsayılan çağrı aralığı 6,5 s (dev'de 110 çağrı/2,2 s → 429; kota ~100 çağrı/pencere)
Some checks are pending
QA Gate (P0/P1) / Test affected app (pull_request) Waiting to run
Some checks are pending
QA Gate (P0/P1) / Test affected app (pull_request) Waiting to run
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
* Shared throttling primitives for carcatonline (used by the worker backfill and
|
||||
* the API's on-demand parts fetch). All state lives in Redis so the API and the
|
||||
* worker share one budget:
|
||||
* - min interval between calls (measured: 1 call / 2 s is sustained, bursts lock the API ~36 min)
|
||||
* - min interval between calls (measured 2026-09-26: ~110 calls at 1/2.2 s → 429 + ~40 min lockout;
|
||||
* the quota looks like ~100 calls per window, so the default is 1 call / 6.5 s ≈ 9/min)
|
||||
* - lockout flag set on any 429
|
||||
* - per-Istanbul-day call counter with a hard cap
|
||||
* - the night window (default 20:00–07:00 Europe/Istanbul) for bulk work
|
||||
@@ -41,7 +42,7 @@ export function carcatConfigFromEnv(env: NodeJS.ProcessEnv = process.env): Carca
|
||||
return Number.isFinite(n) && n >= 0 ? n : d;
|
||||
};
|
||||
return {
|
||||
minIntervalMs: num(env.CARCATONLINE_MIN_INTERVAL_MS, 2200),
|
||||
minIntervalMs: num(env.CARCATONLINE_MIN_INTERVAL_MS, 6500),
|
||||
dailyCallCap: num(env.CARCATONLINE_DAILY_CALL_CAP, 15000),
|
||||
windowStartHour: num(env.CARCATONLINE_WINDOW_START, 20),
|
||||
windowEndHour: num(env.CARCATONLINE_WINDOW_END, 7),
|
||||
|
||||
Reference in New Issue
Block a user