From 89bf8c493eea1a2331946b233280b3a4d0bff895 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 17 Feb 2021 14:46:45 +0000 Subject: [PATCH] Tweaks --- federationsender/queue/queue.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/federationsender/queue/queue.go b/federationsender/queue/queue.go index 87d73f5e7..e77f79cfd 100644 --- a/federationsender/queue/queue.go +++ b/federationsender/queue/queue.go @@ -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)