p2p: avoid blocking on the dequeCh (#6765)

This commit is contained in:
Callum Waters
2021-07-26 15:09:07 +02:00
committed by GitHub
parent c3ae6f5b58
commit a341a626e0
+5 -1
View File
@@ -257,7 +257,11 @@ func (s *pqScheduler) process() {
s.metrics.PeerSendBytesTotal.With(
"chID", chIDStr,
"peer_id", string(pqEnv.envelope.To)).Add(float64(pqEnv.size))
s.dequeueCh <- pqEnv.envelope
select {
case s.dequeueCh <- pqEnv.envelope:
case <-s.closer.Done():
return
}
}
case <-s.closer.Done():