Class: PagesDomains::RetryAcmeOrderService

Inherits:
Object
  • Object
show all
Defined in:
app/services/pages_domains/retry_acme_order_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pages_domain) ⇒ RetryAcmeOrderService

Returns a new instance of RetryAcmeOrderService.


7
8
9
# File 'app/services/pages_domains/retry_acme_order_service.rb', line 7

def initialize(pages_domain)
  @pages_domain = pages_domain
end

Instance Attribute Details

#pages_domainObject (readonly)

Returns the value of attribute pages_domain.


5
6
7
# File 'app/services/pages_domains/retry_acme_order_service.rb', line 5

def pages_domain
  @pages_domain
end

Instance Method Details

#executeObject


11
12
13
14
15
16
17
18
19
# File 'app/services/pages_domains/retry_acme_order_service.rb', line 11

def execute
  updated = pages_domain.with_lock do
    next unless pages_domain.auto_ssl_enabled && pages_domain.auto_ssl_failed

    pages_domain.update!(auto_ssl_failed: false)
  end

  PagesDomainSslRenewalWorker.perform_async(pages_domain.id) if updated
end