Commit f908c72f authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents b6cb3cbb ab0c3e08
......@@ -516,6 +516,12 @@ class ApplicationController < ActionController::Base
def sentry_context
Gitlab::Sentry.context(current_user)
end
def allow_gitaly_ref_name_caching
::Gitlab::GitalyClient.allow_ref_name_caching do
yield
end
end
end
ApplicationController.prepend(EE::ApplicationController)
......@@ -87,10 +87,4 @@ class Projects::ApplicationController < ApplicationController
def check_issues_available!
return render_404 unless @project.feature_available?(:issues, current_user)
end
def allow_gitaly_ref_name_caching
::Gitlab::GitalyClient.allow_ref_name_caching do
yield
end
end
end
......@@ -5,6 +5,8 @@ class SearchController < ApplicationController
include SearchHelper
include RendersCommits
around_action :allow_gitaly_ref_name_caching
skip_before_action :authenticate_user!
requires_cross_project_access if: -> do
search_term_present = params[:search].present? || params[:term].present?
......
---
title: Enable Gitaly ref caching for SearchController
merge_request: 30105
author:
type: performance
......@@ -17,6 +17,10 @@ describe SearchController do
set(:project) { create(:project, :public, :repository, :wiki_repo) }
before do
expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
end
subject { get(:show, params: { project_id: project.id, scope: scope, search: 'merge' }) }
where(:partial, :scope) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment