Fix expires at not updating

This commit is contained in:
Owen
2025-12-09 11:50:33 -05:00
parent 6453b070bb
commit f245632371

View File

@@ -790,12 +790,15 @@ export class TraefikConfigManager {
"utf8" "utf8"
); );
// Store the certificate expiry time logger.info(
if (cert.expiresAt) { `Certificate updated for domain: ${cert.domain}${cert.wildcard ? " (wildcard)" : ""}`
const expiresAtPath = path.join(
domainDir,
".expires_at"
); );
}
// Always update expiry tracking when we fetch a certificate,
// even if the cert content didn't change
if (cert.expiresAt) {
const expiresAtPath = path.join(domainDir, ".expires_at");
fs.writeFileSync( fs.writeFileSync(
expiresAtPath, expiresAtPath,
cert.expiresAt.toString(), cert.expiresAt.toString(),
@@ -803,10 +806,6 @@ export class TraefikConfigManager {
); );
} }
logger.info(
`Certificate updated for domain: ${cert.domain}${cert.wildcard ? " (wildcard)" : ""}`
);
// Update local state tracking // Update local state tracking
this.lastLocalCertificateState.set(cert.domain, { this.lastLocalCertificateState.set(cert.domain, {
exists: true, exists: true,
@@ -814,7 +813,6 @@ export class TraefikConfigManager {
expiresAt: cert.expiresAt, expiresAt: cert.expiresAt,
wildcard: cert.wildcard wildcard: cert.wildcard
}); });
}
// Always ensure the config entry exists and is up to date // Always ensure the config entry exists and is up to date
const certEntry = { const certEntry = {