mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-02-22 10:54:27 -06:00
Fix a couple of bugs
This commit is contained in:
parent
d4bd44ebe6
commit
147b3eddad
|
@ -95,6 +95,8 @@ func (oq *destinationQueue) sendEvent(event *gomatrixserverlib.HeaderedEvent, re
|
||||||
pdu: event,
|
pdu: event,
|
||||||
receipt: receipt,
|
receipt: receipt,
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
oq.overflowed.Store(true)
|
||||||
}
|
}
|
||||||
oq.pendingMutex.Unlock()
|
oq.pendingMutex.Unlock()
|
||||||
// Wake up the queue if it's asleep.
|
// Wake up the queue if it's asleep.
|
||||||
|
@ -136,6 +138,8 @@ func (oq *destinationQueue) sendEDU(event *gomatrixserverlib.EDU, receipt *share
|
||||||
edu: event,
|
edu: event,
|
||||||
receipt: receipt,
|
receipt: receipt,
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
oq.overflowed.Store(true)
|
||||||
}
|
}
|
||||||
oq.pendingMutex.Unlock()
|
oq.pendingMutex.Unlock()
|
||||||
// Wake up the queue if it's asleep.
|
// Wake up the queue if it's asleep.
|
||||||
|
@ -302,10 +306,10 @@ func (oq *destinationQueue) backgroundSend() {
|
||||||
// the pending events and EDUs, and wipe our transaction ID.
|
// the pending events and EDUs, and wipe our transaction ID.
|
||||||
oq.statistics.Success()
|
oq.statistics.Success()
|
||||||
oq.pendingMutex.Lock()
|
oq.pendingMutex.Lock()
|
||||||
for i := range oq.pendingPDUs {
|
for i := range oq.pendingPDUs[:pc] {
|
||||||
oq.pendingPDUs[i] = nil
|
oq.pendingPDUs[i] = nil
|
||||||
}
|
}
|
||||||
for i := range oq.pendingEDUs {
|
for i := range oq.pendingEDUs[:ec] {
|
||||||
oq.pendingEDUs[i] = nil
|
oq.pendingEDUs[i] = nil
|
||||||
}
|
}
|
||||||
oq.pendingPDUs = oq.pendingPDUs[pc:]
|
oq.pendingPDUs = oq.pendingPDUs[pc:]
|
||||||
|
|
Loading…
Reference in a new issue