reduce log spam from empty heartbeat messages

This commit is contained in:
vyzo 2021-07-30 12:58:58 +03:00
parent 37d36d77b1
commit 257d133a07

View File

@ -1296,7 +1296,12 @@ func (gs *GossipSubRouter) heartbeatTimer() {
}
func (gs *GossipSubRouter) heartbeat() {
defer log.Infow("heartbeat")
start := time.Now()
defer func() {
if dt := time.Since(start); dt > time.Millisecond {
log.Infow("heartbeat done", "took", dt)
}
}()
gs.heartbeatTicks++