Pass current periodic activity time from C

This prevents possible inconsistencies between the C and lua time
This commit is contained in:
emanuele-f 2020-03-05 16:21:16 +01:00
parent f041783792
commit 1c7dabf247
7 changed files with 17 additions and 14 deletions

View file

@ -15,8 +15,8 @@ require("ts_second")
local enable_second_debug = false
local ifnames = interface.getIfNames()
-- NOTE: must use gettimeofday otherwise the seconds may not correspond
local when = math.floor(ntop.gettimemsec())
-- NOTE: must use value passed by the C otherwise the seconds may not correspond
local when = _now
local function interface_rrd_creation_enabled(ifid)
return (ntop.getPref("ntopng.prefs.ifid_"..ifid..".interface_rrd_creation") ~= "false")