mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Removes old inefficient alert functions
This commit is contained in:
parent
1a59a9cc80
commit
228c85d850
4 changed files with 1 additions and 40 deletions
|
|
@ -267,27 +267,6 @@ end
|
|||
|
||||
-- #################################
|
||||
|
||||
-- Faster than of getNumAlerts
|
||||
function alert_utils.hasAlerts(what, options)
|
||||
if(what == "engaged") then
|
||||
return(getNumEngagedAlerts(options) > 0)
|
||||
end
|
||||
|
||||
local opts = getUnpagedAlertOptions(options or {})
|
||||
-- limit 1
|
||||
opts.perPage = 1
|
||||
opts.currentPage = 1
|
||||
local res = performAlertsQuery("SELECT rowid", what, opts)
|
||||
|
||||
if((res ~= nil) and (#res == 1)) then
|
||||
return(true)
|
||||
else
|
||||
return(false)
|
||||
end
|
||||
end
|
||||
|
||||
-- #################################
|
||||
|
||||
local function engagedAlertsQuery(params)
|
||||
local type_filter = tonumber(params.alert_id)
|
||||
local entity_type_filter = tonumber(params.entity)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue