aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_check_disk.go
diff options
context:
space:
mode:
authorguosj <515878133@qq.com>2022-04-19 09:25:32 +0800
committerguosj <515878133@qq.com>2022-04-19 09:25:32 +0800
commit82ee31965dd7a1ad2d348c7e9dadb254744bf9b0 (patch)
tree593eb933dffc877010c761b2c55ec6c73875e9a3 /weed/shell/command_volume_check_disk.go
parent5c9a3bb8cf68ed99acb53dd548c92b54744d7fd7 (diff)
parente6ebafc094dc0ce0e3b0a68d7735f52a544bc479 (diff)
downloadseaweedfs-82ee31965dd7a1ad2d348c7e9dadb254744bf9b0.tar.xz
seaweedfs-82ee31965dd7a1ad2d348c7e9dadb254744bf9b0.zip
Merge branch 'master' of https://github.com/chrislusf/seaweedfs into chrislusf-master
Diffstat (limited to 'weed/shell/command_volume_check_disk.go')
-rw-r--r--weed/shell/command_volume_check_disk.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go
index 54edd53dd..53284096d 100644
--- a/weed/shell/command_volume_check_disk.go
+++ b/weed/shell/command_volume_check_disk.go
@@ -9,9 +9,9 @@ import (
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
"github.com/chrislusf/seaweedfs/weed/storage/needle_map"
+ "golang.org/x/exp/slices"
"io"
"math"
- "sort"
)
func init() {
@@ -70,8 +70,8 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
}
for _, replicas := range volumeReplicas {
- sort.Slice(replicas, func(i, j int) bool {
- return fileCount(replicas[i]) > fileCount(replicas[j])
+ slices.SortFunc(replicas, func(a, b *VolumeReplica) bool {
+ return fileCount(a) > fileCount(b)
})
for len(replicas) >= 2 {
a, b := replicas[0], replicas[1]