mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Optimize the getter of the alert category using its ID (#8204)
This commit is contained in:
parent
6e55905708
commit
ce57eef578
2 changed files with 18 additions and 10 deletions
|
|
@ -716,16 +716,7 @@ local function processStoreAlertFromQueue(alert)
|
|||
else
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Unknown alert type " .. (alert.alert_id or ""))
|
||||
end
|
||||
local category = alert_consts.categories.other
|
||||
if (alert.alert_category ~= nil) then
|
||||
for item_category in pairs(alert_consts.categories) do
|
||||
if (alert_consts.categories[item_category].id == alert.alert_category) then
|
||||
category = alert_consts.categories[item_category]
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
end
|
||||
::continue::
|
||||
local category = alert_consts.get_category_by_id(alert.alert_category or 0)
|
||||
type_info:set_category(category)
|
||||
|
||||
return entity_info, type_info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue