Skip to content

Commit

Permalink
add peerUpdate in pull when resetfailover
Browse files Browse the repository at this point in the history
  • Loading branch information
yabinma committed Oct 7, 2024
1 parent ea8fb09 commit 5fb6034
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,20 @@ func pull(w http.ResponseWriter, r *http.Request) {
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
return
}

for _, nodeID := range host.Nodes {
node, err := logic.GetNodeByID(nodeID)
if err != nil {
slog.Error("failed to get node:", "id", node.ID, "error", err)
continue
}
if node.FailedOverBy != uuid.Nil {
go logic.ResetFailedOverPeer(&node)
logic.ResetFailedOverPeer(&node)
go func() {
if err := mq.PublishPeerUpdate(false); err != nil {
logger.Log(0, "fail to publish peer update: ", err.Error())
}
}()
}
}
allNodes, err := logic.GetAllNodes()
Expand Down

0 comments on commit 5fb6034

Please sign in to comment.