Allow environment var GOMAXPROCS=<N> to override NumCPU().

This commit is contained in:
Jonathan Moody 2022-06-06 17:19:26 -04:00 committed by Roy Lee
parent 5f7b1f1b4f
commit 70852905e0

View file

@ -449,7 +449,7 @@ func (ct *ClaimTrie) makeNameHashNext(names [][]byte, all bool, interrupt <-chan
wg.Done() wg.Done()
} }
threads := int(0.8 * float32(runtime.NumCPU())) threads := int(0.8 * float32(runtime.GOMAXPROCS(0)))
if threads < 1 { if threads < 1 {
threads = 1 threads = 1
} }