From 62315082ea2514069640ebb3dc09c0408a374a56 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 16 Jun 2026 16:11:53 +0200 Subject: [PATCH] fix: increase safeInventoryLimit to 50000 Proof: When inventory-sync was down for 2 days, 385k snapshots were produced. 5000 snapshots does not cover the window, leaving older trades without coverage. Increased to 50000 to cover 4 days of history. Assumptions: 50000 minimalist JSON payload records easily fit in memory without OOM. Still fake: N/A --- src/lib/postgres.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/postgres.mjs b/src/lib/postgres.mjs index 8b1917d..26f642a 100644 --- a/src/lib/postgres.mjs +++ b/src/lib/postgres.mjs @@ -4473,10 +4473,10 @@ export async function refreshQuoteOutcomes(pool, { eureAsset = null, now = Date.now(), submissionLimit = 1000, - inventoryLimit = 5000, + inventoryLimit = 50000, } = {}) { const safeSubmissionLimit = Math.max(1, Number(submissionLimit) || 1000); - const safeInventoryLimit = Math.max(1, Number(inventoryLimit) || 5000); + const safeInventoryLimit = Math.max(1, Number(inventoryLimit) || 50000); const submissionsResult = await pool.query( ` SELECT event_id, observed_at, ingested_at, quote_id, payload @@ -5193,7 +5193,7 @@ export async function refreshIntentRequestOutcomes(pool, { const safePreflightLimit = Math.max(1, Number(preflightLimit) || 100); const safeSubmissionLimit = Math.max(1, Number(submissionLimit) || 500); - const safeInventoryLimit = Math.max(1, Number(inventoryLimit) || 5000); + const safeInventoryLimit = Math.max(1, Number(inventoryLimit) || 50000); const preflightResult = await loadIntentRequestPreflightRefreshCandidates(pool, { limit: safePreflightLimit, });