24h forecasting
This commit is contained in:
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user