Skip to content

Commit

Permalink
reduce log spam from empty heartbeat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Jul 30, 2021
1 parent 37d36d7 commit 257d133
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gossipsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++

Expand Down

0 comments on commit 257d133

Please sign in to comment.