]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Branch for LWG work.
[rails.git] / app / controllers / browse_controller.rb
index 96cec39437150ee4a43e223734b7512ce39a131d..a77b0f94a48f71939e16243282e27735bd0f9ac2 100644 (file)
@@ -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