Commit 675f0fe8 authored by Thong Kuah's avatar Thong Kuah

Fix includes to preload to prevent cross-database join

parent 5744c6b7
......@@ -24,9 +24,7 @@ module Search
# rubocop: disable CodeReuse/ActiveRecord
def projects
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/335946') do
@projects ||= ProjectsFinder.new(params: { non_archived: true }, current_user: current_user).execute.includes(:topics, :taggings)
end
@projects ||= ProjectsFinder.new(params: { non_archived: true }, current_user: current_user).execute.preload(:topics, :taggings)
end
def allowed_scopes
......
......@@ -17,9 +17,7 @@ module EE
override :elastic_projects
def elastic_projects
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/335946') do
@elastic_projects ||= projects.pluck_primary_key
end
@elastic_projects ||= projects.pluck_primary_key
end
override :execute
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment