]> Raphaël G. Git Repositories - airbundle/commitdiff
Add skip on weather unavailable data when startup timeout makes us miss upstream...
authorRaphaël Gertz <git@rapsys.eu>
Mon, 16 Aug 2021 23:01:59 +0000 (01:01 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Mon, 16 Aug 2021 23:01:59 +0000 (01:01 +0200)
Command/WeatherCommand.php

index 4b3ea402962ac1e3db318f185cd49cbf68f8a385..c2aae61dc4451ffcb5a8e0e3b1411745bd40168d 100644 (file)
@@ -343,11 +343,11 @@ class WeatherCommand extends DoctrineCommand {
                                        $hour = $type=='daily'?$type:$time->format('H');
 
                                        //Check data availability
-                                       //XXX: should never happen
-                                       #if (!isset($data[$zipcode][$dsm][$hour])) {
-                                       #       //Skip unavailable data
-                                       #       continue;
-                                       #}
+                                       //XXX: sometimes startup delay causes weather data to be unavailable for session first hour
+                                       if (!isset($data[$zipcode][$dsm][$hour])) {
+                                               //Skip unavailable data
+                                               continue;
+                                       }
 
                                        //Set info alias
                                        $info = $data[$zipcode][$dsm][$hour];