24h forecasting

This commit is contained in:
2026-06-24 13:33:08 -04:00
parent 9a9fde7caa
commit 5f71bd182a

View File

@@ -181,15 +181,19 @@ app.get('*', (req, res) => {
// ── Start ───────────────────────────────────────────────────────────────────── // ── Start ─────────────────────────────────────────────────────────────────────
let ready = false async function startForecast() {
while (!ready) { let ready = false
try { while (!ready) {
await refreshForecast() try {
ready = lastForecast.slots.length > 0 await refreshForecast()
} catch {} ready = cache.slots.length > 0
if (!ready) await new Promise(r => setTimeout(r, 5000)) } catch {}
if (!ready) await new Promise(r => setTimeout(r, 5000))
}
setInterval(refreshForecast, 10 * 60 * 1000)
} }
setInterval(refreshForecast, 10 * 60 * 1000)
startForecast()
const c = cfg(); const c = cfg();
app.listen(c.PORT, () => { app.listen(c.PORT, () => {