fix: hardcode safe Tiny throttle defaults
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m9s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m9s
This commit is contained in:
@@ -19,7 +19,10 @@ const inFlightOrderDetails = new Map<string, Promise<OrderDetailsResult | null>>
|
||||
const configuredCacheTtlMs = Number(process.env.TINY_ORDER_DETAILS_CACHE_TTL_MS || 120000);
|
||||
const ORDER_DETAILS_CACHE_TTL_MS = Number.isFinite(configuredCacheTtlMs) ? configuredCacheTtlMs : 120000;
|
||||
const numberEnv = (name: string, fallback: number) => {
|
||||
const value = Number(process.env[name] ?? fallback);
|
||||
const raw = process.env[name];
|
||||
if (raw === undefined || raw.trim() === '') return fallback;
|
||||
|
||||
const value = Number(raw);
|
||||
return Number.isFinite(value) && value >= 0 ? value : fallback;
|
||||
};
|
||||
const LIVE_TINY_REQUEST_DELAY_MS = numberEnv('TINY_LIVE_REQUEST_DELAY_MS', 6000);
|
||||
|
||||
Reference in New Issue
Block a user