summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-11-01 10:33:27 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-11-01 10:33:27 +0000
commit1c50200b9aba86d2ba66b81dee7886a51dc38409 (patch)
tree89bdb19c96a801386f886fcb27eff1e43fb4371e /lib
parent1431ccc010918f34a4834477261b468323bbd939 (diff)
parentd4ef4ad752bf05758351bd0b8761566e40ab0e8e (diff)
downloadgitlab-ce-1c50200b9aba86d2ba66b81dee7886a51dc38409.tar.gz
Merge branch 'sh-optimize-merge-request-project-lookup' into 'master'
Reduce SQL queries needed to load open merge requests See merge request gitlab-org/gitlab-ce!22709
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import/merge_request_helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/import/merge_request_helpers.rb b/lib/gitlab/import/merge_request_helpers.rb
index 97dc1a987c4..9215067d973 100644
--- a/lib/gitlab/import/merge_request_helpers.rb
+++ b/lib/gitlab/import/merge_request_helpers.rb
@@ -22,7 +22,7 @@ module Gitlab
# additional work that is strictly necessary.
merge_request_id = insert_and_return_id(attributes, project.merge_requests)
- merge_request = project.merge_requests.find(merge_request_id)
+ merge_request = project.merge_requests.reload.find(merge_request_id)
# We use .insert_and_return_id which effectively disables all callbacks.
# Trigger iid logic here to make sure we track internal id values consistently.