From ed47f4a30891529eac2fcc99a344038bf3793cc4 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 25 Oct 2016 01:37:16 -0700 Subject: Reduce overhead of LabelFinder by avoiding #presence call Some users experienced 502 timeouts when viewing group labels. Labels#open_issues_count and Label#open_merge_requests_count were taking a long time to load because they were loading every ActiveRecord of the user-accessible projects into memory. This change modifies the system so that #presence and hence to_a isn't called. Closes #23684 --- app/finders/labels_finder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/finders/labels_finder.rb') diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb index 6ace14a4bb5..44c659b609a 100644 --- a/app/finders/labels_finder.rb +++ b/app/finders/labels_finder.rb @@ -48,7 +48,7 @@ class LabelsFinder < UnionFinder end def projects_ids - params[:project_ids].presence + params[:project_ids] end def title -- cgit v1.2.3