aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode/Zurich.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-06-29 13:53:45 +0100
committerDave Arter <davea@mysociety.org>2016-07-08 13:29:37 +0100
commit8430b8c284b3ab0c84ee41b3013a91289e13b254 (patch)
tree7d9334a6d18ca83f7a3de35dcb85f9c9eb25e40f /perllib/FixMyStreet/Geocode/Zurich.pm
parent5b9670512542f54588cc89f2eefc943db26b9ee2 (diff)
Don’t cache geocoder results when STAGING_SITE is 1
Diffstat (limited to 'perllib/FixMyStreet/Geocode/Zurich.pm')
-rw-r--r--perllib/FixMyStreet/Geocode/Zurich.pm4
1 files changed, 2 insertions, 2 deletions
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}) {