changeset 446:ba559d5d44db

fetch_weather: Rename the Tiehallinto static metadata cache filename setting.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 28 Sep 2017 15:17:39 +0300
parents dbe9e233f564
children 11124f9bf994
files config.fetch_weather.example fetch_weather.pl
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/config.fetch_weather.example	Thu Sep 28 15:16:40 2017 +0300
+++ b/config.fetch_weather.example	Thu Sep 28 15:17:39 2017 +0300
@@ -20,7 +20,7 @@
 opt_tiehallinto = 1
 
 ## Tiehallinto static meta data file + path
-tiehallinto_static_meta = "/some/path/weather.tiehallinto.meta"
+tiehallinto_meta = "/some/path/weather.tiehallinto.meta"
 
 ##
 ## Enable/disable open data access from FMI
--- a/fetch_weather.pl	Thu Sep 28 15:16:40 2017 +0300
+++ b/fetch_weather.pl	Thu Sep 28 15:17:39 2017 +0300
@@ -42,9 +42,9 @@
   "purge_threshold" => 60,
   "fmi_api_key" => "",
   "outfile" => "",
-  "tiehallinto_static_meta" => "tiehallinto.meta",
   "http_user_agent" => "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 6.0) Opera 10.63  [en]",
   "tiehallinto_rw_url" => "http://tie.digitraffic.fi/sujuvuus/ws/roadWeather",
+  "tiehallinto_meta" => "tiehallinto.meta",
   "tiehallinto_meta_url" => "http://tie.digitraffic.fi/api/v1/metadata/weather-stations",
 );
 
@@ -372,7 +372,6 @@
       my $data = $xml->{"soap:Body"}{"RoadWeatherResponse"};
 
       # Check if we need to update the static meta data
-      my $meta_file = opt_get("tiehallinto_static_meta");
       my $fetch_meta = (-e $meta_file) ? 0 : 1;
 
       if (defined($data->{"laststaticdataupdate"}))
@@ -382,6 +381,7 @@
         my $tmp2 = (-e $meta_file) ? (stat($meta_file))[9] : -1;
         $fetch_meta = 1 unless ($tmp1 < $tmp2);
       }
+      my $meta_file = opt_get("tiehallinto_meta");
 
       # Fetch or read the cache
       my $meta_str;