Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-08 06:55:29 +0300
committerStan Hu <stanhu@gmail.com>2019-04-08 06:59:40 +0300
commit021e8790c6091994d3b3e31cbf180939608698da (patch)
tree602bb33ff1616e3c45b79a1f3b4e738a3529a17e /app/controllers/projects/tree_controller.rb
parentb4165554113a7f9ce9fecd7d169f9a64686b5c44 (diff)
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.
Diffstat (limited to 'app/controllers/projects/tree_controller.rb')
-rw-r--r--app/controllers/projects/tree_controller.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index 90d53aa08ea..7509cc29a76 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -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]