diff options
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Zurich.pm | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 4470ecbca..257a8d4a3 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -72,7 +72,7 @@ sub cache { my $cache_dir = FixMyStreet->config('GEO_CACHE') . $type . '/'; my $cache_file = $cache_dir . md5_hex($url); my $js; - if (-s $cache_file && -M $cache_file <= 7) { + if (-s $cache_file && -M $cache_file <= 7 && !FixMyStreet->config('STAGING_SITE')) { $js = File::Slurp::read_file($cache_file); } else { $url .= '&' . $args if $args; @@ -80,7 +80,7 @@ sub cache { $js = LWP::Simple::get($url); $js = encode_utf8($js) if utf8::is_utf8($js); File::Path::mkpath($cache_dir); - if ($js && (!$re || $js !~ $re)) { + if ($js && (!$re || $js !~ $re) && !FixMyStreet->config('STAGING_SITE')) { File::Slurp::write_file($cache_file, $js); } } diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index ca893e9d6..671da9722 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -67,7 +67,7 @@ sub string { my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'zurich/'; my $cache_file = $cache_dir . md5_hex($s); my $result; - if (-s $cache_file && -M $cache_file <= 7) { + if (-s $cache_file && -M $cache_file <= 7 && !FixMyStreet->config('STAGING_SITE')) { $result = retrieve($cache_file); } else { my $search = SOAP::Data->name('search' => $s)->type(''); @@ -81,7 +81,7 @@ sub string { } $result = $result->result; File::Path::mkpath($cache_dir); - store $result, $cache_file if $result; + store $result, $cache_file if $result && !FixMyStreet->config('STAGING_SITE'); } if (!$result || !$result->{Location}) { |