Removed useless imports in lua code upping the memory usage

This commit is contained in:
Matteo Biscosi 2024-02-15 15:21:30 +00:00
parent 2f76c9bf4b
commit dbf4bf2a2b
53 changed files with 2981 additions and 3255 deletions

View file

@ -5,20 +5,9 @@
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
-- Hack to avoid include loops
if (pragma_once_callback_utils == true) then
tprint(debug.traceback())
-- avoid multiple inclusions
return
end
pragma_once_callback_utils = true
local os_utils = require "os_utils"
local callback_utils = {}
local clock_start = os.clock()
-- ########################################################
@ -251,6 +240,7 @@ end
-- Iterates each device on the ifname interface.
-- Each device is passed to the callback with some more information.
function callback_utils.foreachDevice(ifname, callback)
require "label_utils"
interface.select(ifname)
local devices_stats = callback_utils.getDevicesIterator()