X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0e849c91c66232c986a54da4a848d77f29bcb5b..56aefb8dcd86aca391285abf84eb53f3e3e03572:/app/controllers/browse_controller.rb?ds=sidebyside diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 96cec3943..a511d67d3 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -81,10 +81,16 @@ class BrowseController < ApplicationController private def timeout - Timeout::timeout(30) do + SystemTimer.timeout_after(30) do yield end + rescue ActionView::TemplateError => ex + if ex.original_exception.is_a?(Timeout::Error) + render :action => "timeout" + else + raise + end rescue Timeout::Error - render :action => "timeout", :status => :request_timeout + render :action => "timeout" end end