Avoids checking disk size when performance is degraded

This commit is contained in:
Simone Mainardi 2020-02-26 16:30:53 +01:00
parent 7083d97523
commit 85330a43f8

View file

@ -3362,7 +3362,8 @@ function getFolderSize(path, timeout)
if size == nil then
size = 0
-- Read disk utilization
if ntop.isdir(path) then
local periodic_activities_utils = require "periodic_activities_utils"
if ntop.isdir(path) and not periodic_activities_utils.have_degraded_performance() then
local du_cmd = string.format("du -s %s 2>/dev/null", path)
if has_timeout then
du_cmd = string.format("timeout %u%s %s", MAX_TIMEOUT, "s", du_cmd)