]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/amf_controller.rb
Merge remote-tracking branch 'upstream/pull/2805'
[rails.git] / app / controllers / api / amf_controller.rb
index c05a130981cdf46bb97cea3af2dca125362822dd..c903cc8e73698b3b36106db31e7a0fa69a3779b0 100644 (file)
@@ -87,7 +87,7 @@ module Api
           result = [-5, nil]
         else
           case message
-          when "putway" then
+          when "putway"
             orn = renumberednodes.dup
             result = putway(renumberednodes, *args)
             result[4] = renumberednodes.reject { |k, _v| orn.key?(k) }
@@ -96,7 +96,7 @@ module Api
             result = putrelation(renumberednodes, renumberedways, *args)
           when "deleteway"
             result = deleteway(*args)
-          when "putpoi" then
+          when "putpoi"
             result = putpoi(*args)
             renumberednodes[result[2]] = result[3] if result[0].zero? && result[2] != result[3]
           when "startchangeset"
@@ -128,11 +128,9 @@ module Api
       [-2, "An unusual error happened (in #{call}). The server said: #{e}"]
     end
 
-    def amf_handle_error_with_timeout(call, rootobj, rootid)
+    def amf_handle_error_with_timeout(call, rootobj, rootid, &block)
       amf_handle_error(call, rootobj, rootid) do
-        OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError) do
-          yield
-        end
+        OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError, &block)
       end
     end