mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Don't block if there are PDUs waiting
This commit is contained in:
parent
5082179ce3
commit
51dba37d7a
|
|
@ -184,6 +184,7 @@ func (oq *destinationQueue) backgroundSend() {
|
||||||
|
|
||||||
// Wait either for incoming events, or until we hit an
|
// Wait either for incoming events, or until we hit an
|
||||||
// idle timeout.
|
// idle timeout.
|
||||||
|
if len(oq.pendingPDUs) == 0 {
|
||||||
select {
|
select {
|
||||||
case <-oq.incomingPDUs:
|
case <-oq.incomingPDUs:
|
||||||
// There are new PDUs waiting in the database.
|
// There are new PDUs waiting in the database.
|
||||||
|
|
@ -223,6 +224,7 @@ func (oq *destinationQueue) backgroundSend() {
|
||||||
// get an event.
|
// get an event.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we are backing off this server then wait for the
|
// If we are backing off this server then wait for the
|
||||||
// backoff duration to complete first, or until explicitly
|
// backoff duration to complete first, or until explicitly
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue