mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Fixes alerts starving in per-recipient queues
This commit is contained in:
parent
6fb8393117
commit
28caa3ac33
6 changed files with 64 additions and 54 deletions
|
|
@ -65,11 +65,10 @@ end
|
|||
|
||||
-- Dequeue alerts from a recipient queue for sending notifications
|
||||
function syslog.dequeueRecipientAlerts(recipient, budget)
|
||||
|
||||
local notifications = ntop.lrangeCache(recipient.export_queue, 0, budget-1)
|
||||
local notifications = ntop.lrangeCache(recipient.export_queue, 0, budget - 1)
|
||||
|
||||
if not notifications or #notifications == 0 then
|
||||
return {success = true}
|
||||
return {success = true, more_available = false}
|
||||
end
|
||||
|
||||
-- Separate by severity and channel
|
||||
|
|
@ -98,7 +97,7 @@ function syslog.dequeueRecipientAlerts(recipient, budget)
|
|||
-- Remove the processed messages from the queue
|
||||
ntop.ltrimCache(recipient.export_queue, #notifications, -1)
|
||||
|
||||
return {success = true}
|
||||
return {success = true, more_available = true}
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue