2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Namespaces
|
|
|
|
class InProductMarketingEmailsWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
2021-06-08 01:23:25 +05:30
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2021-03-11 19:13:27 +05:30
|
|
|
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
|
|
|
|
|
|
|
|
feature_category :subgroups
|
2021-06-08 01:23:25 +05:30
|
|
|
tags :exclude_from_kubernetes
|
2021-03-11 19:13:27 +05:30
|
|
|
urgency :low
|
|
|
|
|
|
|
|
def perform
|
2021-04-29 21:17:54 +05:30
|
|
|
return if paid_self_managed_instance?
|
|
|
|
return if setting_disabled?
|
2021-03-11 19:13:27 +05:30
|
|
|
|
|
|
|
Namespaces::InProductMarketingEmailsService.send_for_all_tracks_and_intervals
|
|
|
|
end
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def paid_self_managed_instance?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def setting_disabled?
|
|
|
|
!Gitlab::CurrentSettings.in_product_marketing_emails_enabled
|
|
|
|
end
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
end
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Namespaces::InProductMarketingEmailsWorker.prepend_mod_with('Namespaces::InProductMarketingEmailsWorker')
|