summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-07 20:55:29 -0700
committerStan Hu <stanhu@gmail.com>2019-04-07 20:59:40 -0700
commit021e8790c6091994d3b3e31cbf180939608698da (patch)
tree602bb33ff1616e3c45b79a1f3b4e738a3529a17e /app/controllers/projects
parentb4165554113a7f9ce9fecd7d169f9a64686b5c44 (diff)
downloadgitlab-ce-021e8790c6091994d3b3e31cbf180939608698da.tar.gz
Enable Gitaly FindCommit caching for TreeControllersh-add-gitaly-ref-name-caching-tree-controller
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')
-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]