mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-02 22:10:26 +08:00
节点配置中对父级节点进行排序,以保证查找的稳定性
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/iwind/TeaGo/rands"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
timeutil "github.com/iwind/TeaGo/utils/time"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -2103,6 +2104,12 @@ func (this *NodeDAO) FindParentNodeConfigs(tx *dbs.Tx, nodeId int64, groupId int
|
||||
Addrs: addrStrings,
|
||||
SecretHash: secretHash,
|
||||
})
|
||||
|
||||
// 排序
|
||||
sort.Slice(parentNodeConfigs, func(i, j int) bool {
|
||||
return parentNodeConfigs[i].Id < parentNodeConfigs[j].Id
|
||||
})
|
||||
|
||||
result[clusterId] = parentNodeConfigs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user