From e2444734fdaaa777094247a32f76a1aa788bf80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 7 Sep 2022 08:58:35 +0000 Subject: [PATCH] Fix certificate worker and retries --- app/workers/certificates.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/workers/certificates.php b/app/workers/certificates.php index 42ead45a26..e8071aa1e5 100644 --- a/app/workers/certificates.php +++ b/app/workers/certificates.php @@ -125,6 +125,9 @@ class CertificatesV1 extends Worker $attempts = $certificate->getAttribute('attempts', 0) + 1; $certificate->setAttribute('attempts', $attempts); + // Store cuttent time as renew date to ensure another attempt in next maintenance cycle + $certificate->setAttribute('renewDate', DateTime::now()); + // Send email to security email $this->notifyError($domain->get(), $e->getMessage(), $attempts); } finally { @@ -290,9 +293,9 @@ class CertificatesV1 extends Worker * * @param string $domain Domain which certificate was generated for * - * @return int + * @return string */ - private function getRenewDate(string $domain): int + private function getRenewDate(string $domain): string { $certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem'; $certData = openssl_x509_parse(file_get_contents($certPath));