Skip to content

Commit

Permalink
core/node: fix divide by zero fatal crash for reprovide rate check (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed May 6, 2024
2 parents eb97cf9 + ca1dc3a commit 65ff619
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/node/provider.go
Expand Up @@ -83,7 +83,11 @@ https://github.com/ipfs/kubo/blob/master/docs/config.md#routingaccelerateddhtcli
}

// How long per block that lasts us.
expectedProvideSpeed := reprovideInterval / time.Duration(count)
expectedProvideSpeed := reprovideInterval
if count > 0 {
expectedProvideSpeed = reprovideInterval / time.Duration(count)
}

if avgProvideSpeed > expectedProvideSpeed {
logger.Errorf(`
🔔🔔🔔 YOU ARE FALLING BEHIND DHT REPROVIDES! 🔔🔔🔔
Expand Down

0 comments on commit 65ff619

Please sign in to comment.