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