Commit 30167193 authored by Stan Hu's avatar Stan Hu

Enable Gitaly ref name caching for discussions.json

This eliminates many potential duplicate FindCommit RPCs for the same
ref, which often occurs in the RelativeLinkFilter#current_commit call.
On the GitLab 12.0 release post, for example, this would save close to
400 RPC calls.
parent 76f49de4
......@@ -16,7 +16,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :authenticate_user!, only: [:assign_related_issues]
before_action :check_user_can_push_to_source_branch!, only: [:rebase]
around_action :allow_gitaly_ref_name_caching, only: [:index, :show]
around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions]
def index
@merge_requests = @issuables
......
---
title: Enable Gitaly ref name caching for discussions.json
merge_request: 29951
author:
type: performance
......@@ -1001,6 +1001,8 @@ describe Projects::MergeRequestsController do
before do
project.add_developer(user)
sign_in(user)
expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
end
it 'returns 200' 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