aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-08-31 17:48:38 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-08-31 17:48:38 +0100
commit0b5f902416b4c61742a303eefaccde51ab71077b (patch)
treeb9cd8a83b1c5575091a4b3743a3dc540e8076df6
parent8e1336875a074adb7f906651233931e0ea4c22b7 (diff)
Increase timeout for Nominatim, to fix #316.
-rw-r--r--perllib/CrossSell.pm3
-rw-r--r--perllib/FixMyStreet/Geocode/OSM.pm3
2 files changed, 4 insertions, 2 deletions
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm
index f9a02a61b..f9cde6936 100644
--- a/perllib/CrossSell.pm
+++ b/perllib/CrossSell.pm
@@ -19,7 +19,6 @@ package CrossSell;
use strict;
use LWP::Simple qw($ua get);
-$ua->timeout(5);
use URI::Escape;
use mySociety::AuthToken;
use mySociety::Web qw(ent);
@@ -169,6 +168,8 @@ sub display_advert ($$;$%) {
return '' unless $c->cobrand->moniker eq 'fixmystreet';
+ $ua->timeout(5);
+
#if (defined $data{council} && $data{council} eq '2326') {
# my ($out, $ad) = display_hfyc_cheltenham_advert($email, $name);
# if ($out) {
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm
index ba939b443..197b2b1e7 100644
--- a/perllib/FixMyStreet/Geocode/OSM.pm
+++ b/perllib/FixMyStreet/Geocode/OSM.pm
@@ -15,7 +15,7 @@ use Digest::MD5 qw(md5_hex);
use Encode;
use File::Slurp;
use File::Path ();
-use LWP::Simple;
+use LWP::Simple qw($ua);
use Memcached;
use XML::Simple;
@@ -49,6 +49,7 @@ sub string {
if (-s $cache_file) {
$js = File::Slurp::read_file($cache_file);
} else {
+ $ua->timeout(15);
$js = LWP::Simple::get($url);
$js = encode_utf8($js) if utf8::is_utf8($js);
File::Path::mkpath($cache_dir);