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

@ -134,14 +134,14 @@ function telegram.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
notifications[#notifications + 1] = notification.alert
else
break
i = i + 1
end
else
break