Commit 81c6ade5 authored by Yorick Peterse's avatar Yorick Peterse

Move EE code out of Gitlab::UsageData

This moves EE specific code out of Gitlab::UsageData and into
EE::Gitlab::UsageData. We also remove the overriding of the "CE" string
with "EE", because EE::Gitlab::UsageData already overrides this with its
own value.
parent 42af0001
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
module EE module EE
module Gitlab module Gitlab
module UsageData module UsageData
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
override :features_usage_data override :features_usage_data
...@@ -142,4 +145,5 @@ module EE ...@@ -142,4 +145,5 @@ module EE
end end
end end
end end
end
end end
...@@ -5,8 +5,6 @@ module Gitlab ...@@ -5,8 +5,6 @@ module Gitlab
APPROXIMATE_COUNT_MODELS = [Label, MergeRequest, Note, Todo].freeze APPROXIMATE_COUNT_MODELS = [Label, MergeRequest, Note, Todo].freeze
class << self class << self
prepend EE::Gitlab::UsageData # rubocop: disable Cop/InjectEnterpriseEditionModule
def data(force_refresh: false) def data(force_refresh: false)
Rails.cache.fetch('usage_data', force: force_refresh, expires_in: 2.weeks) { uncached_data } Rails.cache.fetch('usage_data', force: force_refresh, expires_in: 2.weeks) { uncached_data }
end end
...@@ -31,7 +29,7 @@ module Gitlab ...@@ -31,7 +29,7 @@ module Gitlab
installation_type: Gitlab::INSTALLATION_TYPE, installation_type: Gitlab::INSTALLATION_TYPE,
active_user_count: count(User.active), active_user_count: count(User.active),
recorded_at: Time.now, recorded_at: Time.now,
edition: 'EE' edition: 'CE'
} }
usage_data usage_data
...@@ -192,3 +190,5 @@ module Gitlab ...@@ -192,3 +190,5 @@ module Gitlab
end end
end end
end end
Gitlab::UsageData.prepend(EE::Gitlab::UsageData)
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