First code cleanup for better memory management

This commit is contained in:
Matteo Biscosi 2024-02-14 16:12:28 +00:00
parent b5a4c2621b
commit 2f76c9bf4b
21 changed files with 968 additions and 852 deletions

View file

@ -6,6 +6,19 @@ local redis_api = {}
-- ##############################################
local function is_rrd_enabled()
local driver = ntop.getPref("ntopng.prefs.timeseries_driver")
local is_rrd_enabled = false
if isEmptyString(driver) or driver == "rrd" then
is_rrd_enabled = true
end
return is_rrd_enabled
end
-- ##############################################
local function getRedisStatus()
local redis = ntop.getCacheStatus()
local redis_info = redis["info"]
@ -82,7 +95,7 @@ end
-- ###############################################
function redis_api.redisTimeseriesEnabled()
return(ntop.getPref("ntopng.prefs.system_probes_timeseries") ~= "0")
return(ntop.getPref("ntopng.prefs.system_probes_timeseries") ~= "0" and is_rrd_enabled())
end
-- ###############################################