diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-02 11:16:20 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-02 11:16:20 +0000 |
commit | 40c61acb6a9ba84928cebcbce8b57630bd439615 (patch) | |
tree | 7bed6625acfe7ccfa80dcb0d168ec43454cfef6e /app/controllers | |
parent | a1e58280c21e143dec62a623d0ee227cd3d92d2d (diff) | |
parent | 03f3350f3f679122ce4ceacfc840db6e77763dea (diff) | |
download | gitlab-ce-40c61acb6a9ba84928cebcbce8b57630bd439615.tar.gz |
Merge branch 'feature/fetch-commit-signs-from-gitaly-in-batch' into 'master'
Fetch commit signatures from Gitaly in batches
Closes gitaly#1046
See merge request gitlab-org/gitlab-ce!17456
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/commits_controller.rb | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index 1d910e461b1..7b7cb52d7ed 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -14,37 +14,31 @@ class Projects::CommitsController < Projects::ApplicationController @merge_request = MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened .find_by(source_project: @project, source_branch: @ref, target_branch: @repository.root_ref) - # https://gitlab.com/gitlab-org/gitaly/issues/931 - Gitlab::GitalyClient.allow_n_plus_1_calls do - respond_to do |format| - format.html - format.atom { render layout: 'xml.atom' } + respond_to do |format| + format.html + format.atom { render layout: 'xml.atom' } - format.json do - pager_json( - 'projects/commits/_commits', - @commits.size, - project: @project, - ref: @ref) - end + format.json do + pager_json( + 'projects/commits/_commits', + @commits.size, + project: @project, + ref: @ref) end end end def signatures - # https://gitlab.com/gitlab-org/gitaly/issues/931 - Gitlab::GitalyClient.allow_n_plus_1_calls do - respond_to do |format| - format.json do - render json: { - signatures: @commits.select(&:has_signature?).map do |commit| - { - commit_sha: commit.sha, - html: view_to_html_string('projects/commit/_signature', signature: commit.signature) - } - end - } - end + respond_to do |format| + format.json do + render json: { + signatures: @commits.select(&:has_signature?).map do |commit| + { + commit_sha: commit.sha, + html: view_to_html_string('projects/commit/_signature', signature: commit.signature) + } + end + } end end end |