1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-11 08:54:20 +00:00

Optimize the start speed of optimize

This commit is contained in:
Tw93
2025-12-06 20:57:08 +08:00
parent 1b2da97032
commit 03610e34a5
4 changed files with 22 additions and 21 deletions

View File

@@ -1248,7 +1248,8 @@ get_path_size_kb() {
return
}
local result
result=$(command du -sk "$path" 2> /dev/null | awk '{print $1}')
# Timeout protection: prevent du from hanging on large directories
result=$(run_with_timeout 5 sh -c "command du -sk \"$path\" 2> /dev/null | awk '{print \$1}'")
echo "${result:-0}"
}