mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 14:23:35 +00:00
increased timeout for geoip to 3 seconds
This commit is contained in:
parent
dbecadcaea
commit
d91064a369
2 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ module.exports = GeoIpLookup =
|
||||||
ip = ip.trim().split(" ")[0]
|
ip = ip.trim().split(" ")[0]
|
||||||
opts =
|
opts =
|
||||||
url: "#{settings.apis.geoIpLookup.url}/#{ip}"
|
url: "#{settings.apis.geoIpLookup.url}/#{ip}"
|
||||||
timeout: 1000
|
timeout: 3000
|
||||||
json:true
|
json:true
|
||||||
logger.log ip:ip, opts:opts, "getting geo ip details"
|
logger.log ip:ip, opts:opts, "getting geo ip details"
|
||||||
request.get opts, (err, res, ipDetails)->
|
request.get opts, (err, res, ipDetails)->
|
||||||
|
|
|
@ -43,7 +43,7 @@ describe "GeoIpLookup", ->
|
||||||
|
|
||||||
it "should request the details using the ip", (done)->
|
it "should request the details using the ip", (done)->
|
||||||
@GeoIpLookup.getDetails @ipAddress, (err)=>
|
@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()
|
done()
|
||||||
|
|
||||||
it "should return the ip details", (done)->
|
it "should return the ip details", (done)->
|
||||||
|
@ -53,7 +53,7 @@ describe "GeoIpLookup", ->
|
||||||
|
|
||||||
it "should take the first ip in the string", (done)->
|
it "should take the first ip in the string", (done)->
|
||||||
@GeoIpLookup.getDetails " #{@ipAddress} 456.312.452.102 432.433.888.234", (err)=>
|
@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()
|
done()
|
||||||
|
|
||||||
describe "getCurrencyCode", ->
|
describe "getCurrencyCode", ->
|
||||||
|
|
Loading…
Reference in a new issue