summaryrefslogtreecommitdiff
path: root/app/services/pages_domains
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 21:09:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 21:09:52 +0000
commitae93b284016c07a8a4b47e2510789253d14870f3 (patch)
treec7dc8690b841dd7d3a4eeeca944969d14df582a6 /app/services/pages_domains
parentf697dc5e76dfc5894df006d53b2b7e751653cf05 (diff)
downloadgitlab-ce-ae93b284016c07a8a4b47e2510789253d14870f3.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/pages_domains')
-rw-r--r--app/services/pages_domains/retry_acme_order_service.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/services/pages_domains/retry_acme_order_service.rb b/app/services/pages_domains/retry_acme_order_service.rb
new file mode 100644
index 00000000000..ef3d8ce0b67
--- /dev/null
+++ b/app/services/pages_domains/retry_acme_order_service.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module PagesDomains
+ class RetryAcmeOrderService
+ attr_reader :pages_domain
+
+ def initialize(pages_domain)
+ @pages_domain = pages_domain
+ end
+
+ 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
+ end
+end