Fix case where user's cgroup says it has 0 cpu cores

This commit is contained in:
Nicolas Mowen 2024-08-22 06:58:25 -06:00
parent 1c7ee5f4e4
commit 6b46dd62c3

View File

@ -38,7 +38,7 @@ function get_cpus() {
fi
local cpus
if [ -n "${quota}" ] && [ -n "${period}" ]; then
if [ "${period}" != "0" ] && [ -n "${quota}" ] && [ -n "${period}" ]; then
cpus=$((quota / period))
if [ "$cpus" -eq 0 ]; then
cpus=1