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
f45171bc
Commit
f45171bc
authored
Dec 10, 2021
by
Kamil Trzciński
Committed by
Adam Hegyi
Dec 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register `QueryAnalayzers` in `config.before` to fix `let_it_be`
parent
21fc0769
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
lib/gitlab/database/query_analyzer.rb
lib/gitlab/database/query_analyzer.rb
+2
-2
spec/support/database/query_analyzer.rb
spec/support/database/query_analyzer.rb
+8
-4
No files found.
lib/gitlab/database/query_analyzer.rb
View file @
f45171bc
...
...
@@ -67,8 +67,6 @@ module Gitlab
end
end
private
# Enable query analyzers
def
begin!
analyzers
=
all_analyzers
.
select
do
|
analyzer
|
...
...
@@ -97,6 +95,8 @@ module Gitlab
Thread
.
current
[
:query_analyzer_enabled_analyzers
]
=
nil
end
private
def
enabled_analyzers
Thread
.
current
[
:query_analyzer_enabled_analyzers
]
end
...
...
spec/support/database/query_analyzer.rb
View file @
f45171bc
...
...
@@ -4,11 +4,15 @@
# can be disabled selectively
RSpec
.
configure
do
|
config
|
config
.
around
do
|
example
|
config
.
before
do
|
example
|
if
example
.
metadata
.
fetch
(
:query_analyzers
,
true
)
::
Gitlab
::
Database
::
QueryAnalyzer
.
instance
.
within
{
example
.
run
}
else
example
.
run
::
Gitlab
::
Database
::
QueryAnalyzer
.
instance
.
begin!
end
end
config
.
after
do
|
example
|
if
example
.
metadata
.
fetch
(
:query_analyzers
,
true
)
::
Gitlab
::
Database
::
QueryAnalyzer
.
instance
.
end!
end
end
end
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