Unifies flows, timeseries and top-talkers data retention

Implements #2897
This commit is contained in:
Simone Mainardi 2019-10-07 16:35:32 +02:00
parent 359599c4eb
commit aa652145d0
8 changed files with 75 additions and 80 deletions

View file

@ -0,0 +1,30 @@
--
-- (C) 2014-19 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local DEFAULT_DATA_RETENTION_DAYS = 30
local DATA_RETENTION_DAYS_KEY = "ntopng.prefs.data_retention_days"
local data_retention_utils = {}
-- ########################################################
function data_retention_utils.getDefaultRetention()
return DEFAULT_DATA_RETENTION_DAYS
end
-- ########################################################
function data_retention_utils.getDataRetentionDays()
local data_retention = ntop.getCache(DATA_RETENTION_DAYS_KEY)
return tonumber(data_retention) or data_retention_utils.getDefaultRetention()
end
-- ########################################################
return data_retention_utils