Remove debounce from notification rule

This commit is contained in:
Jackson Harper
2023-09-07 17:24:49 +08:00
parent 89c612e52b
commit edd7246a9b

View File

@ -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')
})