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…
Reference in New Issue