1
0
Fork 0
mirror of synced 2024-07-01 12:40:34 +12:00

CertificateId update fix

This commit is contained in:
Matej Bačo 2022-03-23 14:40:19 +00:00
parent 213215bffa
commit 41cc8bd38d

View file

@ -103,12 +103,14 @@ class CertificatesV1 extends Worker
// This occurs when a cert is already generated because a different project is using the domain // This occurs when a cert is already generated because a different project is using the domain
// By updating here we ensure all domains has certificateId assigned (share same certificate document) // By updating here we ensure all domains has certificateId assigned (share same certificate document)
if(!isset($document['certificateId'])) { if(!isset($document['certificateId'])) {
$certificate = new Document(\array_merge($document, [ $certificate = new Document($certificate);
$domain = new Document(\array_merge($document, [
'updated' => \time(), 'updated' => \time(),
'certificateId' => $certificate->getId(), 'certificateId' => $certificate->getId(),
])); ]));
$certificate = $dbForConsole->updateDocument('domains', $certificate->getId(), $certificate); $domain = $dbForConsole->updateDocument('domains', $domain->getId(), $domain);
if(!$certificate) { if(!$certificate) {
throw new Exception('Failed saving domain to DB'); throw new Exception('Failed saving domain to DB');