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
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-05 14:33:01 +0300
committerStan Hu <stanhu@gmail.com>2019-04-05 14:52:42 +0300
commitf1dce2160956f27fecc4a59d36d1e1e03903a84b (patch)
treeeb046c94683963261349d059978bb8b0af986027 /app
parent3962b00b4bdea67107b9f43e1c44e9bacb98560d (diff)
Enable FindCommit caching for project and commits pages
This reduces a handful of duplicate FindCommit calls while viewing the projects and commits pages.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/commits_controller.rb2
-rw-r--r--app/controllers/projects_controller.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb
index 2510a31c9b3..a49ede04de7 100644
--- a/app/controllers/projects/commits_controller.rb
+++ b/app/controllers/projects/commits_controller.rb
@@ -14,6 +14,8 @@ class Projects::CommitsController < Projects::ApplicationController
before_action :validate_ref!, except: :commits_root
before_action :set_commits, except: :commits_root
+ around_action :allow_gitaly_ref_name_caching
+
def commits_root
redirect_to project_commits_path(@project, @project.default_branch)
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index b7beac00eda..632be29df72 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -26,6 +26,8 @@ class ProjectsController < Projects::ApplicationController
before_action :authorize_admin_project!, only: [:edit, :update, :housekeeping, :download_export, :export, :remove_export, :generate_new_export]
before_action :event_filter, only: [:show, :activity]
+ around_action :allow_gitaly_ref_name_caching, only: [:index, :show]
+
layout :determine_layout
def index