diff --git a/server/scripts/modules/radar.mjs b/server/scripts/modules/radar.mjs index 0a1d768..3dea6f0 100644 --- a/server/scripts/modules/radar.mjs +++ b/server/scripts/modules/radar.mjs @@ -39,9 +39,6 @@ class Radar extends WeatherDisplay { { time: 1, si: 4 }, { time: 12, si: 5 }, ]; - - // get some web workers started - this.workers = (new Array(this.dopplerRadarImageMax)).fill(null).map(() => radarWorker()); } async getData(weatherParameters, refresh) { @@ -53,6 +50,12 @@ class Radar extends WeatherDisplay { return; } + // get the workers started + if (!this.workers) { + // get some web workers started + this.workers = (new Array(this.dopplerRadarImageMax)).fill(null).map(() => radarWorker()); + } + const baseUrl = `https://${RADAR_HOST}/archive/data/`; const baseUrlEnd = '/GIS/uscomp/?F=0&P=n0r*.png'; const baseUrls = [];