From e8d2c2579383897a1dd7f9debd359abe8ae8373d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 20 Jul 2021 09:55:51 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-1-stable-ee --- app/controllers/search_controller.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/controllers/search_controller.rb') diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index ac6239615b4..4160b528301 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -16,6 +16,8 @@ class SearchController < ApplicationController search_term_present && !params[:project_id].present? end + rescue_from ActiveRecord::QueryCanceled, with: :render_timeout + layout 'search' feature_category :global_search @@ -150,6 +152,15 @@ class SearchController < ApplicationController redirect_to new_user_session_path, alert: _('You must be logged in to search across all of GitLab') end + + def render_timeout(exception) + raise exception unless action_name.to_sym == :show + + log_exception(exception) + + @timeout = true + render status: :request_timeout + end end SearchController.prepend_mod_with('SearchController') -- cgit v1.2.1