Fixing current forecast
This commit is contained in:
@@ -10,7 +10,7 @@ import {spec} from './spec.mjs';
|
||||
import {existsSync} from 'fs';
|
||||
import {getAirTraffic, getAirTrafficHistory, getShapes} from './airtraffic.mjs';
|
||||
import {getWeatherCondition} from './openweather.mjs';
|
||||
import {lastForecast, getForecast} from './forecast.mjs';
|
||||
import {lastForecast, getForecast, forecastTTL} from './forecast.mjs';
|
||||
import {dailyWeather, hourlyWeather} from './openmeteo.mjs';
|
||||
|
||||
const app = express();
|
||||
@@ -182,8 +182,8 @@ app.get('*', (req, res) => {
|
||||
// ── Start ─────────────────────────────────────────────────────────────────────
|
||||
const c = cfg();
|
||||
|
||||
setTimeout(getForecast, 2000)
|
||||
setInterval(getForecast, 10 * 60 * 1000)
|
||||
setTimeout(getForecast, 1)
|
||||
setInterval(getForecast, forecastTTL)
|
||||
|
||||
app.listen(c.PORT, () => {
|
||||
console.log(`🌦 Weather API — http://localhost:${c.PORT}`)
|
||||
|
||||
Reference in New Issue
Block a user