2019-06-24 20:35:12 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class PagesDomainSslRenewalWorker # rubocop:disable Scalability/IdempotentWorker
|
2019-06-24 20:35:12 +00:00
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2021-04-30 18:10:09 +00:00
|
|
|
sidekiq_options retry: 3
|
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :pages
|
|
|
|
|
2019-06-24 20:35:12 +00:00
|
|
|
def perform(domain_id)
|
|
|
|
domain = PagesDomain.find_by_id(domain_id)
|
2019-06-13 11:37:45 +00:00
|
|
|
return unless domain&.enabled?
|
2019-07-12 16:53:44 +00:00
|
|
|
return unless ::Gitlab::LetsEncrypt.enabled?
|
2019-06-24 20:35:12 +00:00
|
|
|
|
|
|
|
::PagesDomains::ObtainLetsEncryptCertificateService.new(domain).execute
|
|
|
|
end
|
|
|
|
end
|