Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/query_limiting.rb')
-rw-r--r--lib/gitlab/query_limiting.rb11
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