mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
clearQueue only called by defer so should be safe to delete queue in any case
This commit is contained in:
parent
6a5826cba4
commit
d59b312df0
|
|
@ -247,7 +247,7 @@ func (oq *destinationQueue) backgroundSend() {
|
||||||
}
|
}
|
||||||
destinationQueueRunning.Inc()
|
destinationQueueRunning.Inc()
|
||||||
defer destinationQueueRunning.Dec()
|
defer destinationQueueRunning.Dec()
|
||||||
defer oq.queues.clearQueue(oq.destination)
|
defer oq.queues.clearQueue(oq)
|
||||||
defer oq.running.Store(false)
|
defer oq.running.Store(false)
|
||||||
|
|
||||||
// Mark the queue as overflowed, so we will consult the database
|
// Mark the queue as overflowed, so we will consult the database
|
||||||
|
|
|
||||||
|
|
@ -171,15 +171,14 @@ func (oqs *OutgoingQueues) getQueue(destination gomatrixserverlib.ServerName) *d
|
||||||
return oq
|
return oq
|
||||||
}
|
}
|
||||||
|
|
||||||
func (oqs *OutgoingQueues) clearQueue(destination gomatrixserverlib.ServerName) {
|
func (oqs *OutgoingQueues) clearQueue(oq *destinationQueue) {
|
||||||
oqs.queuesMutex.Lock()
|
oqs.queuesMutex.Lock()
|
||||||
defer oqs.queuesMutex.Unlock()
|
defer oqs.queuesMutex.Unlock()
|
||||||
if oq, ok := oqs.queues[destination]; ok {
|
|
||||||
close(oq.notify)
|
close(oq.notify)
|
||||||
close(oq.interruptBackoff)
|
close(oq.interruptBackoff)
|
||||||
delete(oqs.queues, destination)
|
delete(oqs.queues, oq.destination)
|
||||||
destinationQueueTotal.Dec()
|
destinationQueueTotal.Dec()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ErrorFederationDisabled struct {
|
type ErrorFederationDisabled struct {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue