Skip to content

Commit

Permalink
set peer update for disconnected Node
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Nov 13, 2023
1 parent 595ed5a commit e30b765
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mq/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ func UpdateNode(client mqtt.Client, msg mqtt.Message) {
if ifaceDelta { // reduce number of unneeded updates, by only sending on iface changes
if !newNode.Connected {
err = PublishDeletedNodePeerUpdate(&newNode)
host, err := logic.GetHost(newNode.HostID.String())
if err != nil {
slog.Error("failed to get host for the node", "nodeid", newNode.ID.String(), "error", err)
return
}
allNodes, err := logic.GetAllNodes()
if err == nil {
PublishSingleHostPeerUpdate(host, allNodes, nil, nil)
}
} else {
err = PublishPeerUpdate()
}
Expand Down

0 comments on commit e30b765

Please sign in to comment.