diff options
| author | chrislu <chris.lu@gmail.com> | 2024-11-21 08:54:03 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-11-21 08:54:03 -0800 |
| commit | 04081128a915d6042f809623835e10fff69d69e5 (patch) | |
| tree | 6b2b67e952b2108c96e360ec32355b3807252e09 /weed/shell/command_ec_common.go | |
| parent | 54204bc89b65a323fbf174696240866193e199e4 (diff) | |
| download | seaweedfs-04081128a915d6042f809623835e10fff69d69e5.tar.xz seaweedfs-04081128a915d6042f809623835e10fff69d69e5.zip | |
use math rand v2
Diffstat (limited to 'weed/shell/command_ec_common.go')
| -rw-r--r-- | weed/shell/command_ec_common.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go index 6e7ad7e43..7328fffe7 100644 --- a/weed/shell/command_ec_common.go +++ b/weed/shell/command_ec_common.go @@ -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 { |
