mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 22:03:07 +00:00
Merge pull request #34 from libp2p/fix/go-ipfs/4066
drop messages to slow peers
This commit is contained in:
commit
d1d3a55404
@ -351,7 +351,12 @@ func (p *PubSub) publishMessage(from peer.ID, msg *pb.Message) error {
|
||||
continue
|
||||
}
|
||||
|
||||
go func() { mch <- out }()
|
||||
select {
|
||||
case mch <- out:
|
||||
default:
|
||||
log.Infof("dropping message to peer %s: queue full", pid)
|
||||
// Drop it. The peer is too slow.
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user