Fix recipients. (#6240)

This commit is contained in:
Nicolo Maio 2023-07-21 14:10:21 +00:00
parent 798a41594e
commit 7b7e8a0e87
8 changed files with 57 additions and 42 deletions

View file

@ -104,13 +104,15 @@ function webhook.dequeueRecipientAlerts(recipient, budget)
-- Dequeue MAX_ALERTS_PER_REQUEST notifications
local notifications = {}
for i = 1, MAX_ALERTS_PER_REQUEST do
local i = 0
while i < MAX_ALERTS_PER_REQUEST do
local notification = ntop.recipient_dequeue(recipient.recipient_id)
if notification then
if alert_utils.filter_notification(notification, recipient.recipient_id) then
if alert_utils.filter_notification(notification, recipient.recipient_id) then
notifications[#notifications + 1] = notification.alert
end
i = i + 1
end
else
break
end