From 8bc7ce4ed9c677610bb5229bd30ff26c9d285839 Mon Sep 17 00:00:00 2001 From: Abhishek Kondur Date: Tue, 10 Oct 2023 14:33:18 +0400 Subject: [PATCH] add additional logging --- controllers/hosts.go | 4 ++-- logic/peers.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/hosts.go b/controllers/hosts.go index a587db4a0..6c6bbeccb 100644 --- a/controllers/hosts.go +++ b/controllers/hosts.go @@ -100,13 +100,13 @@ func pull(w http.ResponseWriter, r *http.Request) { } allNodes, err := logic.GetAllNodes() if err != nil { - logger.Log(0, "could not pull peers for host", hostID) + logger.Log(0, "failed to get nodes: ", hostID) logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } hPU, err := logic.GetPeerUpdateForHost("", host, allNodes, nil, nil) if err != nil { - logger.Log(0, "could not pull peers for host", hostID) + logger.Log(0, "could not pull peers for host", hostID, err.Error()) logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } diff --git a/logic/peers.go b/logic/peers.go index ada95ac91..aa3475765 100644 --- a/logic/peers.go +++ b/logic/peers.go @@ -118,7 +118,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N peerHost, err := GetHost(peer.HostID.String()) if err != nil { logger.Log(1, "no peer host", peer.HostID.String(), err.Error()) - return models.HostPeerUpdate{}, err + continue } peerConfig := wgtypes.PeerConfig{ PublicKey: peerHost.PublicKey,