mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Caps du -s execution using a timeout to prevent long activities
This commit is contained in:
parent
23f08f31ed
commit
fee595eabf
5 changed files with 39 additions and 15 deletions
|
|
@ -284,14 +284,15 @@ end
|
|||
-- ########################################################
|
||||
|
||||
-- Read information about the disk space used by rrd (size is in bytes)
|
||||
function rrd_utils.storageInfo(ifid)
|
||||
--! @param timeout the maxium time to compute the size
|
||||
function rrd_utils.storageInfo(ifid, timeout)
|
||||
local dirs = ntop.getDirs()
|
||||
local paths = getRRDPaths()
|
||||
local info = { total = 0 }
|
||||
|
||||
for _, path in pairs(paths) do
|
||||
local absolute_path = os_utils.fixPath(dirs.workingdir .. "/" .. ifid .. "/".. path .."/")
|
||||
info[path] = getFolderSize(absolute_path)
|
||||
info[path] = getFolderSize(absolute_path, timeout)
|
||||
info["total"] = info["total"] + info[path]
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue