From edd7246a9be6bd65a8fec0bf8077351cb6e3b0b8 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 7 Sep 2023 17:24:49 +0800 Subject: [PATCH] Remove debounce from notification rule --- .../api/src/routers/notification_router.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/api/src/routers/notification_router.ts b/packages/api/src/routers/notification_router.ts index 464702269..dc0336756 100644 --- a/packages/api/src/routers/notification_router.ts +++ b/packages/api/src/routers/notification_router.ts @@ -58,17 +58,14 @@ export function notificationRouter() { tokens: tokens.map((token) => token.token), } - // Debounce the sendMulticastPushNotifications function with a delay of 1 minute - debounce(async () => { - const result = await sendMulticastPushNotifications( - userId, - message, - notificationType || 'rule' - ) - if (!result) { - return res.status(400).send({ errorCode: 'SEND_NOTIFICATION_FAILED' }) - } - }, 60 * 1000) + const result = await sendMulticastPushNotifications( + userId, + message, + notificationType || 'rule' + ) + if (!result) { + return res.status(400).send({ errorCode: 'SEND_NOTIFICATION_FAILED' }) + } res.send('OK') })