X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0e849c91c66232c986a54da4a848d77f29bcb5b..ebd109c946d71b3ccc616ea3966e56ae019638d7:/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