Browse Source

Merge pull request #2120 from gravitl/GRA-1392

GRA-1392: skip deleted/disconnected peers in proxy payload
dcarns 2 years ago
parent
commit
17762a3297
1 changed files with 6 additions and 0 deletions
  1. 6 0
      logic/peers.go

+ 6 - 0
logic/peers.go

@@ -71,6 +71,9 @@ func GetProxyUpdateForHost(ctx context.Context, host *models.Host) (models.Proxy
 		if err != nil {
 			continue
 		}
+		if !node.Connected || node.PendingDelete || node.Action == models.NODE_DELETE {
+			continue
+		}
 		currentPeers, err := GetNetworkNodes(node.Network)
 		if err != nil {
 			continue
@@ -80,6 +83,9 @@ func GetProxyUpdateForHost(ctx context.Context, host *models.Host) (models.Proxy
 				//skip yourself
 				continue
 			}
+			if !peer.Connected || peer.PendingDelete || peer.Action == models.NODE_DELETE {
+				continue
+			}
 			peerHost, err := GetHost(peer.HostID.String())
 			if err != nil {
 				continue