Compare commits

...

5 Commits

Author SHA1 Message Date
bcmmbaga
f2f5609c6e Refactor log statement for peer status trace
Move the peer status trace log inside a conditional block to ensure it only logs when the peer status is not connected. This refactor prevents unnecessary logging and streamlines the execution trace.
2024-07-26 11:51:41 +03:00
bcmmbaga
5d81e7aa0c Merge branch 'refs/heads/main' into validate/peer-status 2024-07-26 10:54:52 +03:00
bcmmbaga
2f409bc61c print stack as string 2024-07-25 20:31:36 +03:00
bcmmbaga
50642f5ef3 Add warning log when saving a peer with false status 2024-07-25 20:11:34 +03:00
bcmmbaga
b7da43a91a Add warning log when saving a peer with false status 2024-07-25 18:22:46 +03:00

View File

@@ -309,6 +309,12 @@ func (s *SqlStore) SavePeerStatus(accountID, peerID string, peerStatus nbpeer.Pe
var peerCopy nbpeer.Peer
peerCopy.Status = &peerStatus
if !peerStatus.Connected {
log.WithContext(context.Background()).Tracef("saving peer: %s with false status. PeerCopy %v, Arg: %v, Trace: %s",
peerID, peerCopy.Status.Connected, peerStatus.Connected,
debug.Stack())
}
fieldsToUpdate := []string{
"peer_status_last_seen", "peer_status_connected",
"peer_status_login_expired", "peer_status_required_approval",