auto-retry for some forecast data

This commit is contained in:
Matt Walsh
2022-12-12 13:53:33 -06:00
parent 76fd93e6e1
commit 5dd8f4bd62
16 changed files with 101 additions and 36 deletions

View File

@@ -34,7 +34,7 @@ class LatestObservations extends WeatherDisplay {
// get data for regional stations
const allConditions = await Promise.all(regionalStations.map(async (station) => {
try {
const data = await json(`https://api.weather.gov/stations/${station.id}/observations/latest`);
const data = await json(`https://api.weather.gov/stations/${station.id}/observations/latest`, { retryCount: 3, stillWaiting: () => this.stillWaiting() });
// test for temperature, weather and wind values present
if (data.properties.temperature.value === null
|| data.properties.textDescription === ''