mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-04 01:40:12 +00:00
Implements checks for SQLite recipient queue push return
This commit is contained in:
parent
ddf2970843
commit
7b7f2f193b
3 changed files with 26 additions and 15 deletions
|
|
@ -13,6 +13,7 @@ local sqlite_recipients = {}
|
|||
function sqlite_recipients:create()
|
||||
-- Instance of the base class
|
||||
local _sqlite_recipients = recipients:create()
|
||||
self.enabled = true -- Toggle this to skip dispatch and processing of notifications
|
||||
|
||||
-- Subclass using the base class instance
|
||||
self.key = "sqlite"
|
||||
|
|
@ -27,22 +28,28 @@ end
|
|||
-- ##############################################
|
||||
|
||||
function sqlite_recipients:dispatch_store_notification(notification)
|
||||
ntop.pushSqliteAlert(notification)
|
||||
return true
|
||||
if self.enabled then
|
||||
return ntop.pushSqliteAlert(notification)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function sqlite_recipients:dispatch_release_notification(notification)
|
||||
ntop.pushSqliteAlert(notification)
|
||||
return true
|
||||
if self.enabled then
|
||||
return ntop.pushSqliteAlert(notification)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function sqlite_recipients:process_notifications()
|
||||
if(not areAlertsEnabled()) then
|
||||
return(false)
|
||||
if not self.enabled or not areAlertsEnabled() then
|
||||
return false
|
||||
end
|
||||
|
||||
-- SQLite Alerts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue