Skip to content

Commit

Permalink
Add comment explaining the change
Browse files Browse the repository at this point in the history
  • Loading branch information
Tacklebox committed Dec 6, 2021
1 parent 0b7bf4f commit e835ec4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev-tools/mage/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ func numParallel() int {
maxParallel := runtime.NumCPU()

info, err := GetDockerInfo()
// Check that info.NCPU != 0 since docker info doesn't return with an
// error status if communcation with the daemon failed.
if err == nil && info.NCPU != 0 && info.NCPU < maxParallel {
maxParallel = info.NCPU
}
Expand Down

0 comments on commit e835ec4

Please sign in to comment.