Implements deadlines for periodic and user scripts

This commit is contained in:
Simone Mainardi 2020-02-18 18:44:41 +01:00
parent 7f449f8e64
commit 0e64fd94d6
30 changed files with 117 additions and 112 deletions

View file

@ -57,7 +57,7 @@ end
-- This is necessary both to avoid paying the database io cost inside
-- the other scripts and as a necessity to avoid a deadlock on the
-- host hash in the host.lua script
function alerts_api.checkPendingStoreAlerts(deadline)
function alerts_api.checkPendingStoreAlerts()
if(not areAlertsEnabled()) then
return(false)
end
@ -86,7 +86,7 @@ function alerts_api.checkPendingStoreAlerts(deadline)
end
end
if(os.time() > deadline) then
if ntop.isDeadlineApproaching() then
return(false)
end
end