mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-02-22 10:54:27 -06:00
Clean up better
This commit is contained in:
parent
bfcf1307e8
commit
44187311b6
|
@ -246,6 +246,14 @@ func (oq *destinationQueue) backgroundSend() {
|
|||
// has exceeded a maximum allowable value. Clean up the in-memory
|
||||
// buffers at this point. The PDU clean-up is already on a defer.
|
||||
log.Warnf("Blacklisting %q due to exceeding backoff threshold", oq.destination)
|
||||
for i := pendingPDUs {
|
||||
pendingPDUs[i] = nil
|
||||
}
|
||||
for i := pendingEDUs {
|
||||
pendingEDUs[i] = nil
|
||||
}
|
||||
pendingPDUs = nil
|
||||
pendingEDUs = nil
|
||||
return
|
||||
}
|
||||
if until != nil && until.After(time.Now()) {
|
||||
|
@ -269,6 +277,12 @@ func (oq *destinationQueue) backgroundSend() {
|
|||
// If we successfully sent the transaction then clear out
|
||||
// the pending events and EDUs, and wipe our transaction ID.
|
||||
oq.statistics.Success()
|
||||
for i := pendingPDUs {
|
||||
pendingPDUs[i] = nil
|
||||
}
|
||||
for i := pendingEDUs {
|
||||
pendingEDUs[i] = nil
|
||||
}
|
||||
pendingPDUs = pendingPDUs[:0]
|
||||
pendingEDUs = pendingEDUs[:0]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue