Skip to content

Commit

Permalink
check peer status
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Jan 6, 2025
1 parent 54b41e4 commit 088b4ef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pro/logic/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,12 @@ func checkPeerConnectivity(node *models.Node, metrics *models.Metrics, defaultAc
if err != nil {
continue
}
allowed, _ := logic.IsNodeAllowedToCommunicate(*node, peer, false)
if !defaultAclPolicy && !allowed {
continue

if !defaultAclPolicy {
allowed, _ := logic.IsNodeAllowedToCommunicate(*node, peer, false)
if !allowed {
continue
}
}

if time.Since(peer.LastCheckIn) > models.LastCheckInThreshold {
Expand All @@ -181,7 +184,7 @@ func checkPeerConnectivity(node *models.Node, metrics *models.Metrics, defaultAc
}
// check if peer is in error state
checkPeerStatus(&peer, defaultAclPolicy)
if peer.Status == models.ErrorSt {
if peer.Status == models.ErrorSt || peer.Status == models.WarningSt {
continue
}
peerNotConnectedCnt++
Expand Down

0 comments on commit 088b4ef

Please sign in to comment.