debian-mirror-gitlab/app/workers/namespaces/in_product_marketing_emails_worker.rb

34 lines
813 B
Ruby
Raw Normal View History

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
2021-10-27 15:23:28 +05:30
data_consistency :always
2021-03-11 19:13:27 +05:30
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
2021-11-18 22:05:49 +05:30
feature_category :experimentation_activation
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')