Revert "Revert "Merge branch 'master' of https://github.com/seaweedfs/seaweedfs""

This reverts commit 8cb42c39
This commit is contained in:
chrislu
2023-09-25 09:35:16 -07:00
parent 3d07895518
commit 645ae8c57b
23 changed files with 84 additions and 70 deletions

View File

@@ -3,6 +3,7 @@ package topology
import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"golang.org/x/exp/slices"
"strings"
)
type TopologyInfo struct {
@@ -21,8 +22,8 @@ func (t *Topology) ToInfo() (info TopologyInfo) {
dcs = append(dcs, dc.ToInfo())
}
slices.SortFunc(dcs, func(a, b DataCenterInfo) bool {
return a.Id < b.Id
slices.SortFunc(dcs, func(a, b DataCenterInfo) int {
return strings.Compare(string(a.Id), string(b.Id))
})
info.DataCenters = dcs