Skip to content
Snippets Groups Projects
Commit 021e8790 authored by Stan Hu's avatar Stan Hu
Browse files

Enable Gitaly FindCommit caching for TreeController

Accessing /namespace/project/tree/master appears to query
FindCommit 5 times with identical parameters. This reduces
the number of FindCommit queries to 1.
parent b4165554
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,6 +6,8 @@ class Projects::TreeController < Projects::ApplicationController
include CreatesCommit
include ActionView::Helpers::SanitizeHelper
 
around_action :allow_gitaly_ref_name_caching, only: [:show]
before_action :require_non_empty_project, except: [:new, :create]
before_action :assign_ref_vars
before_action :assign_dir_vars, only: [:create_dir]
Loading
Loading
---
title: Enable Gitaly FindCommit caching for TreeController
merge_request: 27100
author:
type: performance
Loading
Loading
@@ -16,6 +16,8 @@ describe Projects::TreeController do
render_views
 
before do
expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
get(:show,
params: {
namespace_id: project.namespace.to_param,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment