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

in_product_marketing_emails_worker.rb « namespaces « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3070afed3d6a2b27b3bb1977e21b86c3cddac26d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

module Namespaces
  class InProductMarketingEmailsWorker # rubocop:disable Scalability/IdempotentWorker
    include ApplicationWorker
    include CronjobQueue # rubocop:disable Scalability/CronWorkerContext

    feature_category :subgroups
    urgency :low

    def perform
      return if paid_self_managed_instance?
      return if setting_disabled?
      return if experiment_inactive?

      Namespaces::InProductMarketingEmailsService.send_for_all_tracks_and_intervals
    end

    private

    def paid_self_managed_instance?
      false
    end

    def setting_disabled?
      !Gitlab::CurrentSettings.in_product_marketing_emails_enabled
    end

    def experiment_inactive?
      Gitlab.com? && !Gitlab::Experimentation.active?(:in_product_marketing_emails)
    end
  end
end

Namespaces::InProductMarketingEmailsWorker.prepend_if_ee('EE::Namespaces::InProductMarketingEmailsWorker')