Add warning log when saving a peer with false status

This commit is contained in:
bcmmbaga 2024-07-25 18:22:46 +03:00
parent 45fd1e9c21
commit b7da43a91a
No known key found for this signature in database
GPG Key ID: 7249A19D20613553

View File

@ -275,6 +275,12 @@ func (s *SqlStore) SavePeerStatus(accountID, peerID string, peerStatus nbpeer.Pe
var peerCopy nbpeer.Peer
peerCopy.Status = &peerStatus
if !peerCopy.Status.Connected {
log.WithContext(context.Background()).Tracef("saving an peer: %s with false status. PeerCopy %v, Arg: %v, Trace: %v",
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",