Skip to content

Commit

Permalink
Fix archive updation
Browse files Browse the repository at this point in the history
Signed-off-by: sukhman <[email protected]>
  • Loading branch information
sukhman-sukh committed Dec 18, 2024
1 parent f4179b8 commit 4090492
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export async function createDkimRecord(dsp: DomainSelectorPair, dkimDsnRecord: D
return dkimRecord;
}


export async function getLastJWKeySet() {
try {
const lastJwtKey = await prisma.jsonWebKeySets.findFirst({
Expand All @@ -112,9 +111,9 @@ export async function getLastJWKeySet() {
export async function updateJWKeySet() {
try {
const lastJWKeySet = await getLastJWKeySet();
const latestJWKeySet = await fetchJsonWebKeySet();
if (lastJWKeySet?.jwks != latestJWKeySet) {
return await prisma.jsonWebKeySets.create({
const latestx509Cert = await fetchx509Cert();
if (lastJWKeySet?.x509Certificate != latestx509Cert) {
return await prisma.jsonWebKeySets.create({
data: {
jwks: await fetchJsonWebKeySet(),
x509Certificate: await fetchx509Cert(),
Expand Down

0 comments on commit 4090492

Please sign in to comment.