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 ─────────────────────────────────────────────────────────────────────
let ready = false
while (!ready) {
try {
await refreshForecast()
ready = lastForecast.slots.length > 0
} catch {}
if (!ready) await new Promise(r => setTimeout(r, 5000))
async function startForecast() {
let ready = false
while (!ready) {
try {
await refreshForecast()
ready = cache.slots.length > 0
} catch {}
if (!ready) await new Promise(r => setTimeout(r, 5000))
}
setInterval(refreshForecast, 10 * 60 * 1000)
}
setInterval(refreshForecast, 10 * 60 * 1000)
startForecast()
const c = cfg();
app.listen(c.PORT, () => {