From d91064a3698d58a6e2fed817c7480dea6c742cb4 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Nov 2014 11:51:03 +0000 Subject: [PATCH] increased timeout for geoip to 3 seconds --- services/web/app/coffee/infrastructure/GeoIpLookup.coffee | 2 +- .../UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee index a49627d0cb..3f8a16e00d 100644 --- a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee +++ b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee @@ -32,7 +32,7 @@ module.exports = GeoIpLookup = ip = ip.trim().split(" ")[0] opts = url: "#{settings.apis.geoIpLookup.url}/#{ip}" - timeout: 1000 + timeout: 3000 json:true logger.log ip:ip, opts:opts, "getting geo ip details" request.get opts, (err, res, ipDetails)-> diff --git a/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee b/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee index 8f8f559d09..8932da51d4 100644 --- a/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee +++ b/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee @@ -43,7 +43,7 @@ describe "GeoIpLookup", -> it "should request the details using the ip", (done)-> @GeoIpLookup.getDetails @ipAddress, (err)=> - @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:1000, json:true}).should.equal true + @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:3000, json:true}).should.equal true done() it "should return the ip details", (done)-> @@ -53,7 +53,7 @@ describe "GeoIpLookup", -> it "should take the first ip in the string", (done)-> @GeoIpLookup.getDetails " #{@ipAddress} 456.312.452.102 432.433.888.234", (err)=> - @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:1000, json:true}).should.equal true + @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:3000, json:true}).should.equal true done() describe "getCurrencyCode", ->