mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 12:53:09 +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)
|
||||
for _, peer := range p.peers {
|
||||
peer <- out
|
||||
for pid, peer := range p.peers {
|
||||
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