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