diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-10 06:09:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-10 06:09:10 +0300 |
commit | 5d756f9966c2f91b96cef7e552693e5bd1f1fb21 (patch) | |
tree | 4edd5c50411c21c57867d57a776e6c8a67d6f247 /lib/gitlab/query_limiting.rb | |
parent | 23e66f03108f811dbb6f9aa4fc463f888666522d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/query_limiting.rb')
-rw-r--r-- | lib/gitlab/query_limiting.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/gitlab/query_limiting.rb b/lib/gitlab/query_limiting.rb index 31e6b120e45..5e46e26e14e 100644 --- a/lib/gitlab/query_limiting.rb +++ b/lib/gitlab/query_limiting.rb @@ -4,9 +4,8 @@ module Gitlab module QueryLimiting # Returns true if we should enable tracking of query counts. # - # This is only enabled in production/staging if we're running on GitLab.com. - # This ensures we don't produce any errors that users can't do anything - # about themselves. + # This is only enabled in development and test to ensure we don't produce + # any errors that users of other environments can't do anything about themselves. def self.enable? Rails.env.development? || Rails.env.test? end @@ -19,7 +18,7 @@ module Gitlab # The issue URL is only meant to push developers into creating an issue # instead of blindly whitelisting offending blocks of code. def self.whitelist(issue_url) - return unless enable_whitelist? + return unless enable? unless issue_url.start_with?('https://') raise( @@ -30,9 +29,5 @@ module Gitlab Transaction&.current&.whitelisted = true end - - def self.enable_whitelist? - Rails.env.development? || Rails.env.test? - end end end |