Commit 60da7090 authored by Peter Leitzen's avatar Peter Leitzen

Improve performance of Rails backtrace cleaner configuration

Prefer Regexp#match?(String) over String#=~(Regexp).
parent bb1405a1
---
title: Improve performance of Rails backtrace cleaner configuration
merge_request: 40182
author:
type: performance
...@@ -2,7 +2,7 @@ Rails.backtrace_cleaner.remove_silencers! ...@@ -2,7 +2,7 @@ Rails.backtrace_cleaner.remove_silencers!
# This allows us to see the proper caller of SQL calls in {development,test}.log # This allows us to see the proper caller of SQL calls in {development,test}.log
if (Rails.env.development? || Rails.env.test?) && Gitlab.ee? if (Rails.env.development? || Rails.env.test?) && Gitlab.ee?
Rails.backtrace_cleaner.add_silencer { |line| line =~ %r(^ee/lib/gitlab/database/load_balancing) } Rails.backtrace_cleaner.add_silencer { |line| %r(^ee/lib/gitlab/database/load_balancing).match?(line) }
end end
Rails.backtrace_cleaner.add_silencer { |line| line !~ Gitlab::APP_DIRS_PATTERN } Rails.backtrace_cleaner.add_silencer { |line| !Gitlab::APP_DIRS_PATTERN.match?(line) }
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