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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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