Log disconnect/connect event
Marketing was relying on mailserver entries for checking the time a give peer spent on the app. This was not accurate as the assumption was that a peer would "ping" a mailserver every 15s, which is not the case, it only hit the mailserver as it comes from an "offline" state. This commit changes the log level of two entries so that we have connect/disconnect time for a given peer, which should be enough to calculate roughly the time a peer has been online if connected to our fleet.
This commit is contained in:
parent
40343b3140
commit
86e0ec8e10
|
@ -1083,7 +1083,7 @@ func (w *Waku) HandlePeer(peer common.Peer, rw p2p.MsgReadWriter) error {
|
||||||
w.peers[peer] = struct{}{}
|
w.peers[peer] = struct{}{}
|
||||||
w.peerMu.Unlock()
|
w.peerMu.Unlock()
|
||||||
|
|
||||||
w.logger.Debug("handling peer", zap.String("id", types.EncodeHex(peer.ID())))
|
w.logger.Info("handling peer", zap.String("peerID", types.EncodeHex(peer.ID())))
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
w.peerMu.Lock()
|
w.peerMu.Lock()
|
||||||
|
@ -1105,7 +1105,7 @@ func (w *Waku) HandlePeer(peer common.Peer, rw p2p.MsgReadWriter) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
err := peer.Run()
|
err := peer.Run()
|
||||||
w.logger.Debug("handled peer", zap.String("id", types.EncodeHex(peer.ID())), zap.Error(err))
|
w.logger.Info("handled peer", zap.String("peerID", types.EncodeHex(peer.ID())), zap.Error(err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue