diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/support/helpers/query_recorder.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/support/helpers/query_recorder.rb')
-rw-r--r-- | spec/support/helpers/query_recorder.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/helpers/query_recorder.rb b/spec/support/helpers/query_recorder.rb index d18a1d23584..01839a74e65 100644 --- a/spec/support/helpers/query_recorder.rb +++ b/spec/support/helpers/query_recorder.rb @@ -80,7 +80,8 @@ module ActiveRecord if values[:cached] && skip_cached @cached << values[:sql] - elsif !skip_schema_queries || !values[:name]&.include?("SCHEMA") + elsif !ignorable?(values) + backtrace = @query_recorder_debug ? show_backtrace(values, duration) : nil @log << values[:sql] store_sql_by_source(values: values, duration: duration, backtrace: backtrace) @@ -102,5 +103,12 @@ module ActiveRecord def occurrences @occurrences ||= @log.group_by(&:to_s).transform_values(&:count) end + + def ignorable?(values) + return true if skip_schema_queries && values[:name]&.include?("SCHEMA") + return true if values[:name]&.match(/License Load/) + + false + end end end |