summaryrefslogtreecommitdiff
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb11
1 files changed, 11 insertions, 0 deletions
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')