This commit is contained in:
Neil Alexander 2021-02-17 14:46:45 +00:00
parent cbf5f6ee89
commit 89bf8c493e
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -174,9 +174,8 @@ func (oqs *OutgoingQueues) getQueue(destination gomatrixserverlib.ServerName) *d
func (oqs *OutgoingQueues) clearQueues() {
oqs.queuesMutex.Lock()
queues := oqs.queues
oqs.queuesMutex.Unlock()
for _, q := range queues {
defer oqs.queuesMutex.Unlock()
for _, q := range oqs.queues {
oqs.clearQueue(q)
}
time.AfterFunc(time.Minute, oqs.clearQueues)
@ -191,7 +190,6 @@ func (oqs *OutgoingQueues) clearQueue(oq *destinationQueue) {
case oq.backingOff.Load():
return
}
close(oq.notify)
close(oq.interruptBackoff)
delete(oqs.queues, oq.destination)