Always update the domain even if wildcard changes

This commit is contained in:
Owen
2026-04-24 12:14:06 -07:00
parent d08f276794
commit 537f9ae66b

View File

@@ -312,8 +312,7 @@ async function syncAcmeCerts(
.from(certificates) .from(certificates)
.where( .where(
and( and(
eq(certificates.domain, domain), eq(certificates.domain, domain)
eq(certificates.wildcard, wildcard)
) )
) )
.limit(1); .limit(1);
@@ -392,6 +391,9 @@ async function syncAcmeCerts(
} }
if (existing.length > 0) { if (existing.length > 0) {
logger.debug(
`acmeCertSync: updating existing certificate for ${domain} (expires ${expiresAt ? new Date(expiresAt * 1000).toISOString() : "unknown"})`
);
await db await db
.update(certificates) .update(certificates)
.set({ .set({
@@ -416,6 +418,9 @@ async function syncAcmeCerts(
oldKeyPem oldKeyPem
); );
} else { } else {
logger.debug(
`acmeCertSync: inserting new certificate for ${domain} (expires ${expiresAt ? new Date(expiresAt * 1000).toISOString() : "unknown"})`
);
await db.insert(certificates).values({ await db.insert(certificates).values({
domain, domain,
domainId, domainId,