fix: hardcode safe Tiny throttle defaults
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m9s

This commit is contained in:
Cauê Faleiros
2026-06-23 10:34:12 -03:00
parent aa581a4d14
commit 83f165381d
3 changed files with 17 additions and 11 deletions

View File

@@ -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);