Added missing json require to alerts_api.lua (#9948)

This commit is contained in:
Matteo Biscosi 2026-01-13 10:27:46 +01:00
parent 22ddfdcca4
commit 3c0ae41a9d

View file

@ -13,6 +13,7 @@ require "ntop_utils"
local alert_entities = require "alert_entities"
local alert_consts = require "alert_consts"
local recipients = require "recipients"
local json = require("dkjson")
local alert_entity_builders = require "alert_entity_builders"
local do_trace = false
@ -205,7 +206,6 @@ end
-- ! @param when (optional) the time when the release event occurs
-- ! @return true if the alert was successfully stored, false otherwise
function alerts_api.store(entity_info, type_info, when)
local json = require("dkjson")
if (not areAlertsEnabled()) then
return (false)
end
@ -307,8 +307,6 @@ end
-- ! @note The actual trigger is performed asynchronously
-- ! @note false is also returned if an existing alert is found and refreshed
function alerts_api.trigger(entity_info, type_info, when, cur_alerts)
local json = require("dkjson")
if (not areAlertsEnabled()) then
return (false)
end