Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
675f0fe8
Commit
675f0fe8
authored
Sep 02, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix includes to preload to prevent cross-database join
parent
5744c6b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
app/services/search/global_service.rb
app/services/search/global_service.rb
+1
-3
ee/app/services/ee/search/group_service.rb
ee/app/services/ee/search/group_service.rb
+1
-3
No files found.
app/services/search/global_service.rb
View file @
675f0fe8
...
...
@@ -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
...
...
ee/app/services/ee/search/group_service.rb
View file @
675f0fe8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment