diff options
| author | chrislu <chris.lu@gmail.com> | 2024-08-29 09:52:21 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-08-29 09:52:21 -0700 |
| commit | a4b25a642d6b2ed6056496ffddce864100932f3d (patch) | |
| tree | 181b5690d9d257e2833b257992be6d29f78fb817 /weed/topology/node.go | |
| parent | ded5e084ea324c074e61bc74bba0bfaeb2af88d7 (diff) | |
| download | seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.tar.xz seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.zip | |
math/rand => math/rand/v2
Diffstat (limited to 'weed/topology/node.go')
| -rw-r--r-- | weed/topology/node.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/topology/node.go b/weed/topology/node.go index 851e71385..7e443533f 100644 --- a/weed/topology/node.go +++ b/weed/topology/node.go @@ -2,7 +2,7 @@ package topology import ( "errors" - "math/rand" + "math/rand/v2" "strings" "sync" "sync/atomic" @@ -83,7 +83,7 @@ func (n *NodeImpl) PickNodesByWeight(numberOfNodes int, option *VolumeGrowOption //pick nodes randomly by weights, the node picked earlier has higher final weights sortedCandidates := make([]Node, 0, len(candidates)) for i := 0; i < len(candidates); i++ { - weightsInterval := rand.Int63n(totalWeights) + weightsInterval := rand.Int64N(totalWeights) lastWeights := int64(0) for k, weights := range candidatesWeights { if (weightsInterval >= lastWeights) && (weightsInterval < lastWeights+weights) { |
