CertificateId update fix
This commit is contained in:
parent
213215bffa
commit
41cc8bd38d
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue