X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a41f1b297b68abd3a88185044b13113329367d79..901d77837b9c1a432c158f1ed5f9a90bf71b8588:/app/controllers/api_controller.rb?ds=sidebyside diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 370b3f746..564f71899 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -1,8 +1,8 @@ class ApiController < ApplicationController - session :off before_filter :check_api_readable, :except => [:capabilities] after_filter :compress_output + around_filter :api_call_handle_error, :api_call_timeout # Help methods for checking boundary sanity and area size include MapBoundary @@ -182,7 +182,7 @@ class ApiController < ApplicationController # this "uniq" may be slightly inefficient; it may be better to first collect and output # all node-related relations, then find the *not yet covered* way-related ones etc. relations.uniq.each do |relation| - doc.root << relation.to_xml_node(changeset_cache, user_display_name_cache) + doc.root << relation.to_xml_node(nil, changeset_cache, user_display_name_cache) end response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\"" @@ -262,6 +262,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