From: Raphaƫl Gertz Date: Sat, 26 Apr 2025 03:28:55 +0000 (+0200) Subject: Prevent fetching 4th day daily weather triggering a 404 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/175ee00ad5fe1db247a779b059276c0b79258370 Prevent fetching 4th day daily weather triggering a 404 --- diff --git a/Command/WeatherCommand.php b/Command/WeatherCommand.php index b499390..0318383 100644 --- a/Command/WeatherCommand.php +++ b/Command/WeatherCommand.php @@ -177,6 +177,12 @@ class WeatherCommand extends DoctrineCommand { //Set stop day $day = $stop->diff((new \DateTime('now'))->setTime(0, 0, 0))->d + 1; + //Skip 4th day + //XXX: accuweather only allow until 3rd day + if ($day >= 4) { + continue; + } + //Check if zipcode date is set if (!isset($zipcodes[$zipcode][$day])) { $zipcodes[$zipcode][$day] = [ $sessionId => $sessionId ];