From 04dfad1a26db840eb675b838b69d5121a2808de4 Mon Sep 17 00:00:00 2001 From: Nils Briggen Date: Fri, 12 Jun 2026 08:22:38 +0200 Subject: [PATCH] Refit Team-DC once more after boot ingestion settles The boot refit fires before live state is restored, so restarts lost this tournament's matches from the fit until the nightly timer. A one-shot follow-up at +5 minutes closes the gap. Co-Authored-By: Claude Fable 5 --- server/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index 787bd37..7d45122 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -229,7 +229,12 @@ export function buildServer() { const refitTimer = setInterval(() => { if (model.refitTeamDc(state.allFixtures())) broadcast(); }, 24 * 60 * 60 * 1000); - app.addHook('onClose', async () => clearInterval(refitTimer)); + // The boot refit ran before ingestion restored finished matches — run once + // more after the boot sweep settles so a restart keeps tournament context. + const refitOnce = setTimeout(() => { + if (model.refitTeamDc(state.allFixtures())) broadcast(); + }, 5 * 60_000); + app.addHook('onClose', async () => { clearInterval(refitTimer); clearTimeout(refitOnce); }); // ---- static SPA (prod) with history fallback + per-route OG meta ---- if (existsSync(STATIC_DIR)) {