X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c9f9ade96fef0e058704bd8583eb44dddff9965e..21adea321b6c705b0e0eb7acc667566869b3015d:/app/controllers/api/amf_controller.rb diff --git a/app/controllers/api/amf_controller.rb b/app/controllers/api/amf_controller.rb index c05a13098..c903cc8e7 100644 --- a/app/controllers/api/amf_controller.rb +++ b/app/controllers/api/amf_controller.rb @@ -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