Use OSM::Timer (and hence SystemTimer) consistently
This commit is contained in:
parent
00a605a2a8
commit
3aa1c46aef
3 changed files with 3 additions and 3 deletions
|
@ -128,7 +128,7 @@ class AmfController < ApplicationController
|
|||
|
||||
def amf_handle_error_with_timeout(call,rootobj,rootid)
|
||||
amf_handle_error(call,rootobj,rootid) do
|
||||
Timeout::timeout(API_TIMEOUT, OSM::APITimeoutError) do
|
||||
OSM::Timer.timeout(API_TIMEOUT, OSM::APITimeoutError) do
|
||||
yield
|
||||
end
|
||||
end
|
||||
|
|
|
@ -89,7 +89,7 @@ module ApplicationHelper
|
|||
url = "http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{language}"
|
||||
|
||||
begin
|
||||
response = Timeout::timeout(4) do
|
||||
response = OSM::Timer.timeout(4) do
|
||||
REXML::Document.new(Net::HTTP.get(URI.parse(url)))
|
||||
end
|
||||
rescue Exception
|
||||
|
|
|
@ -455,7 +455,7 @@ module OSM
|
|||
end
|
||||
|
||||
def self.IPToCountry(ip_address)
|
||||
Timeout::timeout(4) do
|
||||
Timer.timeout(4) do
|
||||
ipinfo = Quova::IpInfo.new(ip_address)
|
||||
|
||||
if ipinfo.status == Quova::Success then
|
||||
|
|
Loading…
Add table
Reference in a new issue