diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 00:08:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 00:08:41 +0000 |
commit | e40710ab8a30f36d7c82d7d6497033291840eec9 (patch) | |
tree | aea450b24cb1bd8023c1d297e4f01de4e88926b2 /app/controllers/dashboard | |
parent | 51612d3ef5be853289008694c40973b479e8547c (diff) | |
download | gitlab-ce-e40710ab8a30f36d7c82d7d6497033291840eec9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r-- | app/controllers/dashboard/projects_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb index d5ccec28fdd..039991e07a2 100644 --- a/app/controllers/dashboard/projects_controller.rb +++ b/app/controllers/dashboard/projects_controller.rb @@ -66,7 +66,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController @total_user_projects_count = ProjectsFinder.new(params: { non_public: true }, current_user: current_user).execute @total_starred_projects_count = ProjectsFinder.new(params: { starred: true }, current_user: current_user).execute - finder_params[:use_cte] = Feature.enabled?(:use_cte_for_projects_finder, default_enabled: true) + finder_params[:use_cte] = true if use_cte_for_finder? projects = ProjectsFinder .new(params: finder_params, current_user: current_user) @@ -79,6 +79,11 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController end # rubocop: enable CodeReuse/ActiveRecord + def use_cte_for_finder? + # The starred action loads public projects, which causes the CTE to be less efficient + action_name == 'index' && Feature.enabled?(:use_cte_for_projects_finder, default_enabled: true) + end + def load_events projects = load_projects(params.merge(non_public: true)) |