X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0e849c91c66232c986a54da4a848d77f29bcb5b..5e9ae68fb223195f67bfb3992f1d7b0116437d71:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 96cec3943..a77b0f94a 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -81,9 +81,15 @@ 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", :status => :request_timeout + else + raise + end rescue Timeout::Error render :action => "timeout", :status => :request_timeout end