diff options
author | Stan Hu <stanhu@gmail.com> | 2019-04-04 23:22:11 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-04 23:42:58 +0300 |
commit | f2fa7c32992db5a2b1b6acadc6c203c93c139f3b (patch) | |
tree | 5fd2fe091e3762f3a72f585d957957615e3f84ce /app/controllers/projects/application_controller.rb | |
parent | e2425149760830b04c85dbfe8b01e65c472c33f3 (diff) |
Fix and expand Gitaly FindCommit caching
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26248 added
support for deduplicating FindCommit requests using Gitaly ref name
caching. However, not all endpoints were covered, and in one case the
Gitaly wrapper wasn't actually surrounding the serialization step. We
can safely cache ref names between FindCommit calls for #index and #show
endpoints for merge requests and pipelines. This can significantly
reduce the number of FindCommit requests.
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r-- | app/controllers/projects/application_controller.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index 6504fd6c08a..781eac7f080 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -88,4 +88,10 @@ class Projects::ApplicationController < ApplicationController def check_issues_available! return render_404 unless @project.feature_available?(:issues, current_user) end + + def allow_gitaly_ref_name_caching + ::Gitlab::GitalyClient.allow_ref_name_caching do + yield + end + end end |