From bf66cd1d1d4faa249c692f13543e43f2bd6b0c03 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 19 Jan 2012 12:40:06 +0000 Subject: Forbid very slow-to-load results pages Another temporary patch to protect the live site. --- app/controllers/request_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 1c7aeedcc..90c1f416d 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -155,6 +155,13 @@ class RequestController < ApplicationController if @view == "recent" return redirect_to request_list_all_path(:action => "list", :view => "all", :page => @page), :status => :moved_permanently end + + # Temporary patch + # Later pages are very expensive to load + if @page > 100 + raise "Sorry. No pages after 100 today." + end + params[:latest_status] = @view query = make_query_from_params @title = _("View and search requests") -- cgit v1.2.3