移除节点归属地查询功能,归属地查询放到网关实现;优化节点上线流程,网关根据节点状态提交增量更新数据
This commit is contained in:
@@ -193,7 +193,10 @@ func onOpen(ctx context.Context, writer io.Writer, edgeId int32, addr net.Addr)
|
||||
return errors.New("没有可用的端口")
|
||||
}
|
||||
|
||||
app.NewEdge(edgeId, port, tcpAddr)
|
||||
err := app.NewEdge(edgeId, port, tcpAddr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("新增边缘节点失败:%w", err)
|
||||
}
|
||||
|
||||
app.LockPortAssign.Unlock()
|
||||
} else {
|
||||
@@ -201,7 +204,7 @@ func onOpen(ctx context.Context, writer io.Writer, edgeId int32, addr net.Addr)
|
||||
port = *edge.Port
|
||||
err := app.TryUpdateEdge(edgeId, tcpAddr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("尝试更新边缘节点地址失败: %w", err)
|
||||
return fmt.Errorf("尝试更新边缘节点失败: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user