24h forecasting

This commit is contained in:
2026-06-24 13:31:58 -04:00
parent 88f86646af
commit 9a9fde7caa
2 changed files with 9 additions and 10 deletions

View File

@@ -10,8 +10,7 @@ import {spec} from './spec.mjs';
import {existsSync} from 'fs';
import {getAirTraffic, getAirTrafficHistory, getShapes} from './airtraffic.mjs';
import {getWeatherCondition} from './openweather.mjs';
import {refreshForecast} from './forecast.mjs';
import {cache} from 'express/lib/application.js';
import {lastForecast, refreshForecast} from './forecast.mjs';
const app = express();
const DIR = dirname(fileURLToPath(import.meta.url));
@@ -186,7 +185,7 @@ let ready = false
while (!ready) {
try {
await refreshForecast()
ready = cache.slots.length > 0
ready = lastForecast.slots.length > 0
} catch {}
if (!ready) await new Promise(r => setTimeout(r, 5000))
}