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

pages_domain_ssl_renewal_cron_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 43fb35c52981cd82932510078bf951073b27f8c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class PagesDomainSslRenewalCronWorker # rubocop:disable Scalability/IdempotentWorker
  include ApplicationWorker
  include CronjobQueue

  feature_category :pages

  def perform
    return unless ::Gitlab::LetsEncrypt.enabled?

    PagesDomain.need_auto_ssl_renewal.with_logging_info.find_each do |domain|
      # Ideally that should be handled in PagesDomain.need_auto_ssl_renewal scope
      # but it's hard to make scope work with feature flags
      # once we remove feature flag we can modify scope to implement this behaviour
      next if Feature.enabled?(:pages_letsencrypt_errors, domain.project) && domain.auto_ssl_failed

      with_context(project: domain.project) do
        PagesDomainSslRenewalWorker.perform_async(domain.id)
      end
    end
  end
end