mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-08 15:53:07 +00:00
Drop announce messages to peers when their buffer is full
This commit is contained in:
parent
63c977c815
commit
2ac19f2157
@ -230,8 +230,12 @@ func (p *PubSub) announce(topic string, sub bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
out := rpcWithSubs(subopt)
|
out := rpcWithSubs(subopt)
|
||||||
for _, peer := range p.peers {
|
for pid, peer := range p.peers {
|
||||||
peer <- out
|
select {
|
||||||
|
case peer <- out:
|
||||||
|
default:
|
||||||
|
log.Infof("dropping announce message to peer %s: queue full", pid)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user