]> git.openstreetmap.org Git - rails.git/commitdiff
Raising an exception in Ruby requires a .new. Add a timeout line to the capabilities...
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Thu, 21 May 2009 14:05:09 +0000 (14:05 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Thu, 21 May 2009 14:05:09 +0000 (14:05 +0000)
app/controllers/api_controller.rb
config/initializers/abstract_adapter.rb

index 285558bcfc490537e54a22c3c55d61b0c27e0a30..31871921949c6f4c9fb6985f54903d60a6a05648 100644 (file)
@@ -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
 
index 7b22a3cc6ccbd95cf5deda3203de5bbb87985d05..cfa32e4e93325336f979fd4289bfd701398913f1 100644 (file)
@@ -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