Skip to content

Commit f398eed

Browse files
committed
Hopefully fix ACME cert refresh
1 parent 50efb35 commit f398eed

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/tls-certificates/acme.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ export class AcmeCA {
9494
// we're OK to do it async and keep using the current one for now.
9595
console.log(`Renewing near-expiry certificate for ${domain} (${options.attemptId})`);
9696

97-
this.pendingCertRenewals[domain] = Object.assign(this.getCertificate(domain, {
98-
forceRegenerate: true,
99-
attemptId: options.attemptId
100-
}), { id: options.attemptId });
97+
// Trigger update in the background, catch any errors. This will add itself to pendingCertRenewals
98+
// so no need to update that separately.
99+
this.getCertificate(domain, { forceRegenerate: true, attemptId: options.attemptId }).catch((e) => {
100+
console.log(`Background <1 week refresh failed with ${e.message}`);
101+
});
101102
} else {
102103
console.log(`Certificate refresh already pending for ${domain} (${options.attemptId}) from attempt ${
103104
this.pendingCertRenewals[domain]!.id

0 commit comments

Comments
 (0)