]> git.openstreetmap.org Git - rails.git/commitdiff
Use OSM::Timer (and hence SystemTimer) consistently
authorTom Hughes <tom@compton.nu>
Fri, 6 Jan 2012 09:13:52 +0000 (09:13 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 6 Jan 2012 09:13:52 +0000 (09:13 +0000)
app/controllers/amf_controller.rb
app/helpers/application_helper.rb
lib/osm.rb

index 86e57a2d1bd9c6642510d46a2f26520d7a6936df..139a7a65078058ac2a791161c9797faf72a1e9e8 100644 (file)
@@ -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
index b256dac4c8fca11a91a95c16658138b5bb20fa55..c7187c31d62e932e94047f52ec222c4d9d221b3c 100644 (file)
@@ -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
index a85a7dfecd91be7d22ee18f07c3e8c252371932a..dd62d6620c7ca4f06eb7f726ba962eb0a39e0241 100644 (file)
@@ -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