fix: speed up rollups

This commit is contained in:
nate 2026-04-09 03:54:12 +04:00
parent 4bf8d1b20d
commit 89f0856a04
1 changed files with 5 additions and 3 deletions

View File

@ -105,7 +105,9 @@ export async function startRollupJob() {
console.error("[rollup] force-run check failed:", e); console.error("[rollup] force-run check failed:", e);
} }
// Periodic refreshes for the *current* bucket of each resolution. // Periodic refreshes for the *current* bucket of each resolution. Each query
setInterval(() => { rollupCurrent("hourly").catch((e) => console.warn("[rollup] hourly failed:", e)); }, 5 * 60 * 1000); // is bounded by the current bucket only (date_trunc(...)) so it stays cheap
setInterval(() => { rollupCurrent("daily").catch((e) => console.warn("[rollup] daily failed:", e)); }, 30 * 60 * 1000); // even at high cadence.
setInterval(() => { rollupCurrent("hourly").catch((e) => console.warn("[rollup] hourly failed:", e)); }, 30 * 1000); // every 30s
setInterval(() => { rollupCurrent("daily").catch((e) => console.warn("[rollup] daily failed:", e)); }, 5 * 60 * 1000); // every 5min
} }