自动创建默认集群

This commit is contained in:
GoEdgeLab
2020-10-14 18:44:34 +08:00
parent 59046aae19
commit 965efed323
4 changed files with 57 additions and 0 deletions

View File

@@ -465,6 +465,16 @@ func (this *NodeDAO) UpdateNodeConnectedAPINodes(nodeId int64, apiNodeIds []int6
return err
}
// 根据UniqueId获取ID
// TODO 增加缓存
func (this *NodeDAO) FindEnabledNodeIdWithUniqueId(uniqueId string) (int64, error) {
return this.Query().
State(NodeStateEnabled).
Attr("uniqueId", uniqueId).
ResultPk().
FindInt64Col(0)
}
// 生成唯一ID
func (this *NodeDAO) genUniqueId() (string, error) {
for {