From: Shaun McDonald Date: Thu, 21 May 2009 14:05:09 +0000 (+0000) Subject: Raising an exception in Ruby requires a .new. Add a timeout line to the capabilities... X-Git-Tag: live~7410 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d4954bc7b1bc06431bea4e97af401e3ea6acd0e6 Raising an exception in Ruby requires a .new. Add a timeout line to the capabilities call. --- diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 285558bcf..318719219 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -263,6 +263,9 @@ class ApiController < ApplicationController changesets = XML::Node.new 'changesets' changesets['maximum_elements'] = Changeset::MAX_ELEMENTS.to_s api << changesets + timeout = XML::Node.new 'timeout' + timeout['seconds'] = APP_CONFIG['api_timeout'].to_s + api << timeout doc.root << api diff --git a/config/initializers/abstract_adapter.rb b/config/initializers/abstract_adapter.rb index 7b22a3cc6..cfa32e4e9 100644 --- a/config/initializers/abstract_adapter.rb +++ b/config/initializers/abstract_adapter.rb @@ -14,7 +14,7 @@ module ActiveRecord end rescue ActiveRecord::StatementInvalid => ex if ex =~ /^OSM::APITimeoutError: / - raise OSM::APITimeoutError + raise OSM::APITimeoutError.new else raise end