fix EcVolumes sorting in volume UI (#6275)

* Update store_ec.go

* fix: EcVolume sorting not work

* use stdlib

* revert
This commit is contained in:
Trim21
2024-11-24 14:43:08 +08:00
committed by GitHub
parent ccf1795e6f
commit fd6c787c02

View File

@@ -3,13 +3,14 @@ package storage
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/seaweedfs/seaweedfs/weed/pb"
"golang.org/x/exp/slices"
"io" "io"
"os" "os"
"slices"
"sync" "sync"
"time" "time"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/klauspost/reedsolomon" "github.com/klauspost/reedsolomon"
"github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/glog"
@@ -405,7 +406,7 @@ func (s *Store) EcVolumes() (ecVolumes []*erasure_coding.EcVolume) {
location.ecVolumesLock.RUnlock() location.ecVolumesLock.RUnlock()
} }
slices.SortFunc(ecVolumes, func(a, b *erasure_coding.EcVolume) int { slices.SortFunc(ecVolumes, func(a, b *erasure_coding.EcVolume) int {
return int(b.VolumeId - a.VolumeId) return int(a.VolumeId) - int(b.VolumeId)
}) })
return ecVolumes return ecVolumes
} }