From 3b9c45a317e2197b823cea6676679a2acb3dc336 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 18 Sep 2017 20:43:28 -0700 Subject: [PATCH] Remove unnecessary loading of discussions in `IssuesController#show` Discussions are now done asynchronously via the `IssuesController#discussions` endpoint, so this should no longer be needed. This was taking 32% of the load time for GitLab CE issue 1. Closes #38034 --- app/controllers/projects/issues_controller.rb | 3 --- changelogs/unreleased/sh-stop-loading-issue-discussions.yml | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/sh-stop-loading-issue-discussions.yml diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 42bfa4b9d4f..a3ec79a56d9 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -71,9 +71,6 @@ class Projects::IssuesController < Projects::ApplicationController @noteable = @issue @note = @project.notes.new(noteable: @issue) - @discussions = @issue.discussions - @notes = prepare_notes_for_rendering(@discussions.flat_map(&:notes), @noteable) - respond_to do |format| format.html format.json do diff --git a/changelogs/unreleased/sh-stop-loading-issue-discussions.yml b/changelogs/unreleased/sh-stop-loading-issue-discussions.yml new file mode 100644 index 00000000000..5e7b7387c0d --- /dev/null +++ b/changelogs/unreleased/sh-stop-loading-issue-discussions.yml @@ -0,0 +1,5 @@ +--- +title: Remove unnecessary loading of discussions in `IssuesController#show` +merge_request: +author: +type: fixed