mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Remove debounce from notification rule
This commit is contained in:
parent
89c612e52b
commit
edd7246a9b
1 changed files with 8 additions and 11 deletions
|
|
@ -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')
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue