debian-mirror-gitlab/app/workers/namespaces/in_product_marketing_emails_worker.rb
2021-06-08 01:23:25 +05:30

39 lines
988 B
Ruby

# frozen_string_literal: true
module Namespaces
class InProductMarketingEmailsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :subgroups
tags :exclude_from_kubernetes
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_mod_with('Namespaces::InProductMarketingEmailsWorker')