From cb9d2b3c10f6ab0a560ec1717360f5415e0c9476 Mon Sep 17 00:00:00 2001 From: TD <50856799+SerpentBytes@users.noreply.github.com> Date: Tue, 25 Apr 2023 16:52:43 -0400 Subject: [PATCH] Deal with multiple notifications * attempt to make exipiration notifications work * remove unused constant --- .../expiration-notification.server.ts | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/services/expiration/expiration-notification.server.ts b/services/expiration/expiration-notification.server.ts index e91ca3af..c20b75ac 100644 --- a/services/expiration/expiration-notification.server.ts +++ b/services/expiration/expiration-notification.server.ts @@ -15,9 +15,6 @@ declare global { var __expiration_init__: boolean; } -// constant for notification frequency in days -const NOTIFICATION_FREQUENCY = 7; - // name for the queue const expirationNotificationQueueName = 'expiration-notification'; @@ -151,17 +148,7 @@ const getExpiringCertificates = () => { lte: dayjs().add(30, 'd').toDate(), }, status: 'issued', - - OR: [ - { - lastNotified: null, - }, - { - lastNotified: dayjs() - .subtract(NOTIFICATION_FREQUENCY * 4, 'd') - .toDate(), - }, - ], + lastNotified: null, }, include: { user: true }, }); @@ -173,16 +160,7 @@ const getExpiringDnsRecords = () => { expiresAt: { lte: dayjs().add(30, 'd').toDate(), }, - OR: [ - { - lastNotified: null, - }, - { - lastNotified: dayjs() - .subtract(NOTIFICATION_FREQUENCY * 4, 'd') - .toDate(), - }, - ], + lastNotified: null, }, include: { user: true }, });