File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ func (mp *MultiPool) next(lbs LoadBalancingStrategy) (idx int) {
124124 case RoundRobin :
125125 return int (atomic .AddUint32 (& mp .index , 1 ) % uint32 (len (mp .pools )))
126126 case LeastTasks :
127- leastTasks := 1 << 31 - 1
127+ leastTasks := math . MaxInt32
128128 for i , pool := range mp .pools {
129129 if n := pool .Running (); n < leastTasks {
130130 leastTasks = n
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ func (mp *MultiPoolWithFunc) next(lbs LoadBalancingStrategy) (idx int) {
7171 case RoundRobin :
7272 return int (atomic .AddUint32 (& mp .index , 1 ) % uint32 (len (mp .pools )))
7373 case LeastTasks :
74- leastTasks := 1 << 31 - 1
74+ leastTasks := math . MaxInt32
7575 for i , pool := range mp .pools {
7676 if n := pool .Running (); n < leastTasks {
7777 leastTasks = n
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ func (mp *MultiPoolWithFuncGeneric[T]) next(lbs LoadBalancingStrategy) (idx int)
6767 case RoundRobin :
6868 return int (atomic .AddUint32 (& mp .index , 1 ) % uint32 (len (mp .pools )))
6969 case LeastTasks :
70- leastTasks := 1 << 31 - 1
70+ leastTasks := math . MaxInt32
7171 for i , pool := range mp .pools {
7272 if n := pool .Running (); n < leastTasks {
7373 leastTasks = n
You can’t perform that action at this time.
0 commit comments