]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Merge branch 'master' into openid
[rails.git] / app / controllers / browse_controller.rb
index 96cec39437150ee4a43e223734b7512ce39a131d..a511d67d35fb54cc558ff124a894abf03469540f 100644 (file)
@@ -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