mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 05:43:06 +00:00
fix backoff slack time
This commit is contained in:
parent
8c08ebaecb
commit
46536eccc4
@ -1497,10 +1497,11 @@ func (gs *GossipSubRouter) clearBackoff() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now().Add(2 * GossipSubHeartbeatInterval)
|
now := time.Now()
|
||||||
for topic, backoff := range gs.backoff {
|
for topic, backoff := range gs.backoff {
|
||||||
for p, expire := range backoff {
|
for p, expire := range backoff {
|
||||||
if expire.Before(now) {
|
// add some slack time to the expiration
|
||||||
|
if expire.Add(2 * GossipSubHeartbeatInterval).Before(now) {
|
||||||
delete(backoff, p)
|
delete(backoff, p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user