mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-11 08:47:46 +02:00
use math rand v2
This commit is contained in:
1 parent
54204bc89b
commit
04081128a9
1 file changed
+2
-2
@@ -3,7 +3,7 @@ package shell
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"math/rand/v2"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/operation"
|
||||
@@ -564,7 +564,7 @@ func pickRackToBalanceShardsInto(rackToEcNodes map[RackId]*EcRack, rackToShardCo
|
||||
if len(targets) == 0 {
|
||||
return ""
|
||||
}
|
||||
return targets[rand.Intn(len(targets))]
|
||||
return targets[rand.IntN(len(targets))]
|
||||
}
|
||||
|
||||
func balanceEcShardsWithinRacks(commandEnv *CommandEnv, allEcNodes []*EcNode, racks map[RackId]*EcRack, collection string, applyBalancing bool) error {
|
||||
|
||||
Reference in new issue
Block a user