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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /lib/gitlab/query_limiting.rb
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
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