Commit b0d8e619 authored by alinamihaila's avatar alinamihaila

Skip usage ping generation on GitLab.com

parent d7ed14ee
...@@ -17,6 +17,9 @@ class SubmitUsagePingService ...@@ -17,6 +17,9 @@ class SubmitUsagePingService
SubmissionError = Class.new(StandardError) SubmissionError = Class.new(StandardError)
def execute def execute
# Disable usage ping for GitLab.com
# See https://gitlab.com/gitlab-org/gitlab/-/issues/292929 for details
return if Gitlab.com?
return unless Gitlab::CurrentSettings.usage_ping_enabled? return unless Gitlab::CurrentSettings.usage_ping_enabled?
return if User.single_user&.requires_usage_stats_consent? return if User.single_user&.requires_usage_stats_consent?
......
...@@ -80,6 +80,14 @@ RSpec.describe SubmitUsagePingService do ...@@ -80,6 +80,14 @@ RSpec.describe SubmitUsagePingService do
end end
end end
context 'when GitLab.com' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
end
it_behaves_like 'does not run'
end
context 'when usage ping is disabled' do context 'when usage ping is disabled' do
before do before do
stub_application_setting(usage_ping_enabled: false) stub_application_setting(usage_ping_enabled: false)
......
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