Much fresher live data: 8s in-play polling, live-TTL summary fetches

The live staleness bug: liveTick refetched ESPN summaries every 20s but
the cache TTL was 5 minutes, so in-play stats/timeline barely moved.
Summaries now take a live flag (15s TTL in play), the scoreboard TTL
drops 20s->5s, and polling gets three tiers (8s in-play / 20s near
kickoff / 10m idle) via a pure, tested cadence module. The
football-data fallback is throttled to one attempt per 15s so the 8s
cadence can never breach its 10 req/min cap. Enrichment runs every 5m
(was 20m); client refetch intervals tighten to 10s (live match page)
and 30s (scoreboard).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 23:18:38 +02:00
parent dda8e1ae42
commit a3f529746f
7 changed files with 76 additions and 11 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ export function MatchPreviewPage() {
.then((d: MatchPreview) => alive && setPreview(d))
.catch(() => alive && setFailed(true));
void load();
const id = setInterval(() => { if (useTournamentStore.getState().snapshot?.fixtures.find((f) => f.num === Number(numParam))?.status === 'live') void load(); }, 20_000);
const id = setInterval(() => { if (useTournamentStore.getState().snapshot?.fixtures.find((f) => f.num === Number(numParam))?.status === 'live') void load(); }, 10_000);
return () => { alive = false; clearInterval(id); };
}, [numParam]);