# HG changeset patch # User Matti Hamalainen # Date 1506601059 -10800 # Node ID ba559d5d44db4f957bc2f00624f756264d191995 # Parent dbe9e233f56498e443c869e09822dd5ec4237b4d fetch_weather: Rename the Tiehallinto static metadata cache filename setting. diff -r dbe9e233f564 -r ba559d5d44db config.fetch_weather.example --- 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 diff -r dbe9e233f564 -r ba559d5d44db fetch_weather.pl --- 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;