You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e25f62c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(radar): stop serving an expired forecast when FMI is down (#1009)
`Cache::get_stale` matched on key alone, with no age bound, so a flaky
upstream pinned the last good response indefinitely. FMI's download
service drops connections mid-response often enough to exhaust the
3-attempt retry budget, and the radar handler then fell back to whatever
was in the cache — overnight, that was the previous evening's grid.
Because the cache is server-side and shared, the panel only recovered
when some other client's request happened to catch FMI healthy.
- `get_stale` now requires a `max_age`; all six call sites pass a bound.
3 h for the precip forecast, 1 h for radar frames and Solis live state,
6 h for weather and spot — generous enough that nothing else changes in
practice, but no endpoint can serve yesterday's data as today's.
- Forecast frames carry absolute valid times, so a cached grid ages out
frame by frame rather than all at once. `future_frames` trims the
elapsed head on every response path; nothing left means 502, which the
frontend's retry and "ei saatavilla" hint already cover.
- `Cache-Control: no-store` on the `/api` scope, mirrored in the fetchers.
iOS Safari heuristically caches unlabelled GETs. `DefaultHeaders` only
fills an absent header, so the WMS tile route keeps its max-age=300.
- RainMap refetches on `visibilitychange` (iOS suspends refreshInterval
while backgrounded), trims its in-memory copy for the gap before that
lands, and derives the "+N h" label from each frame's own timestamp
instead of its array index.
0 commit comments