Skip to content

Commit

Permalink
improve error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
  • Loading branch information
mudler committed Aug 16, 2024
1 parent db336bc commit 50aa8e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ func ensureService(ctx context.Context, n *node.Node, nd *NodeData, sserv string
// Start the service
port, err := freeport.GetFreePort()
if err != nil {
fmt.Print(err)
zlog.Error().Err(err).Msgf("Could not allocate a free port for %s", nd.ID)
return
}

tunnelAddress := fmt.Sprintf("127.0.0.1:%d", port)
nd.TunnelAddress = tunnelAddress
service[nd.Name] = nodeServiceData{
Expand Down

0 comments on commit 50aa8e9

Please sign in to comment.