Skip to content

Commit

Permalink
fix: count cpu's correctly when process name includes the word proces…
Browse files Browse the repository at this point in the history
…sor (#4)
  • Loading branch information
zackpollard authored Jun 12, 2024
1 parent ae46797 commit 8dda6c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion get_cpus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [ -n "${quota:-}" ] && [ -n "${period:-}" ]; then
cpus=1
fi
else
cpus=$(grep -c processor /proc/cpuinfo)
cpus=$(grep -c ^processor /proc/cpuinfo)
fi

verbose "CPUs:"
Expand Down
2 changes: 1 addition & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readonly script_dir

cd "$script_dir/.."

machine_cpus=$(grep -c processor /proc/cpuinfo)
machine_cpus=$(grep -c ^processor /proc/cpuinfo)

docker_cmd=(docker run --rm -v "${PWD}:${PWD}" -w "${PWD}" -e VERBOSE -e DEBUG)

Expand Down

0 comments on commit 8dda6c4

Please sign in to comment.