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