+ ##
+ # wrap a web page in a timeout
+ def web_timeout
+ SystemTimer.timeout_after(APP_CONFIG['web_timeout']) 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"
+ end
+