Skip to content

Commit 0c901be

Browse files
committed
NumCPU -> GOMAXPROCS
1 parent 3dcbcdd commit 0c901be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/orchestrator/poller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ func WithPollerWorker(cfg *worker.Worker) PollerOption {
6060
func NewPoller(rpc rpc.IRPCClient, storage storage.IStorage, opts ...PollerOption) *Poller {
6161
parallelPollers := config.Cfg.Poller.ParallelPollers
6262
if parallelPollers == 0 {
63-
parallelPollers = runtime.NumCPU()
63+
parallelPollers = runtime.GOMAXPROCS(0)
64+
if parallelPollers < 1 {
65+
parallelPollers = 1
66+
}
6467
}
6568

6669
// Set the lookahead -> number of pollers + 2

0 commit comments

Comments
 (0)