From 68ed1b8b33f7285f9db4e0f9eb175370fea928fb Mon Sep 17 00:00:00 2001 From: Abhishek Kondur Date: Fri, 6 Jan 2023 17:52:17 +0530 Subject: [PATCH] periodic host updates --- mq/publishers.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mq/publishers.go b/mq/publishers.go index 181dd98f..ef981523 100644 --- a/mq/publishers.go +++ b/mq/publishers.go @@ -139,7 +139,7 @@ func ProxyUpdate(proxyPayload *proxy_models.ProxyManagerPayload, node *models.No // sendPeers - retrieve networks, send peer ports to all peers func sendPeers() { - networks, err := logic.GetNetworks() + hosts, err := logic.GetAllHosts() if err != nil { logger.Log(1, "error retrieving networks for keepalive", err.Error()) } @@ -164,13 +164,12 @@ func sendPeers() { //collectServerMetrics(networks[:]) } - for _, network := range networks { + for _, host := range hosts { if force { logger.Log(2, "sending scheduled peer update (5 min)") - err = PublishPeerUpdate(network.NetID, false) + err = PublishSingleHostUpdate(&host) if err != nil { - logger.Log(1, "error publishing udp port updates for network", network.NetID) - logger.Log(1, err.Error()) + logger.Log(1, "error publishing peer updates for host: ", host.ID.String(), " Err: ", err.Error()) } } }