summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-10-25 15:55:59 +0000
committerRémy Coutable <remy@rymai.me>2016-10-25 18:25:36 +0200
commit5dea12ac22a808261a610ac156c33ef5c09c2bfd (patch)
tree4b2e8603647355778f6b6fe37d819bf381e75b85
parent0778461d7960b9d159b04a59adc93c66ee67f218 (diff)
downloadgitlab-ce-5dea12ac22a808261a610ac156c33ef5c09c2bfd.tar.gz
Merge branch 'sh-optimize-label-finder' into 'master'
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 so that only the IDs are loaded into memory. Closes #23684 See merge request !7094 Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/finders/labels_finder.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05686885656..53100174fa2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Fix reply-by-email not working due to queue name mismatch. !7068
- Fix 404 for group pages when GitLab setup uses relative url. !7071
- Fix `User#to_reference`. !7088
+ - Reduce overhead of `LabelFinder` by avoiding `#presence` call. !7094
- Fix unauthorized users dragging on issue boards. !7096
## 8.13.0 (2016-10-22)
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb
index 95e62cdb02a..44484d64567 100644
--- a/app/finders/labels_finder.rb
+++ b/app/finders/labels_finder.rb
@@ -50,7 +50,7 @@ class LabelsFinder < UnionFinder
end
def projects_ids
- params[:project_ids].presence
+ params[:project_ids]
end
def title