mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
Tweak order in destinationQueue.next
This commit is contained in:
parent
f646964e85
commit
b15b5c7f0d
|
|
@ -112,6 +112,11 @@ func (oq *destinationQueue) next() *gomatrixserverlib.Transaction {
|
|||
oq.runningMutex.Lock()
|
||||
defer oq.runningMutex.Unlock()
|
||||
|
||||
if len(oq.pendingEvents) == 0 && len(oq.pendingEDUs) == 0 && len(oq.pendingInvites) == 0 {
|
||||
oq.running = false
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(oq.pendingInvites) > 0 {
|
||||
for _, inviteReq := range oq.pendingInvites {
|
||||
ev := inviteReq.Event()
|
||||
|
|
@ -131,11 +136,6 @@ func (oq *destinationQueue) next() *gomatrixserverlib.Transaction {
|
|||
oq.pendingInvites = oq.pendingInvites[:0]
|
||||
}
|
||||
|
||||
if len(oq.pendingEvents) == 0 && len(oq.pendingEDUs) == 0 {
|
||||
oq.running = false
|
||||
return nil
|
||||
}
|
||||
|
||||
t := gomatrixserverlib.Transaction{
|
||||
PDUs: []json.RawMessage{},
|
||||
EDUs: []gomatrixserverlib.EDU{},
|
||||
|
|
|
|||
Loading…
Reference in a new issue