From 5fb6034f6d2b1a42957657f283c25bf4a5984e0a Mon Sep 17 00:00:00 2001 From: Max Ma Date: Mon, 7 Oct 2024 16:39:51 +0200 Subject: [PATCH] add peerUpdate in pull when resetfailover --- controllers/hosts.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/hosts.go b/controllers/hosts.go index 349894331..bae8eb3e1 100644 --- a/controllers/hosts.go +++ b/controllers/hosts.go @@ -167,6 +167,7 @@ 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 { @@ -174,7 +175,12 @@ func pull(w http.ResponseWriter, r *http.Request) { 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()