Skip to content

Commit

Permalink
Fix case where user's cgroup says it has 0 cpu cores (#13271)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored Aug 22, 2024
1 parent 1c7ee5f commit e01b6ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e01b6ee

Please sign in to comment.