From 8bc9de2fe09b778d23a1b0052bcee82d779ed9be Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 3 Jul 2020 16:24:46 +0100 Subject: [PATCH] We don't really need Ch here do we --- federationsender/queue/destinationqueue.go | 6 +++--- federationsender/queue/queue.go | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/federationsender/queue/destinationqueue.go b/federationsender/queue/destinationqueue.go index 93bb6a8c2..70e50d2e8 100644 --- a/federationsender/queue/destinationqueue.go +++ b/federationsender/queue/destinationqueue.go @@ -56,7 +56,7 @@ type destinationQueue struct { pendingEDUs []*gomatrixserverlib.EDU // owned by backgroundSend pendingInvites []*gomatrixserverlib.InviteV2Request // owned by backgroundSend notifyPDUs chan bool // interrupts idle wait for PDUs - interruptBackoffCh chan bool // interrupts backoff + interruptBackoff chan bool // interrupts backoff } // Send event adds the event to the pending queue for the destination. @@ -133,7 +133,7 @@ func (oq *destinationQueue) sendInvite(ev *gomatrixserverlib.InviteV2Request) { func (oq *destinationQueue) wakeQueueIfNeeded() { // If we are backing off then interrupt the backoff. if oq.backingOff.CAS(true, false) { - oq.interruptBackoffCh <- true + oq.interruptBackoff <- true } // If we aren't running then wake up the queue. if !oq.running.Load() { @@ -217,7 +217,7 @@ func (oq *destinationQueue) backgroundSend() { oq.backingOff.Store(true) select { case <-time.After(duration): - case <-oq.interruptBackoffCh: + case <-oq.interruptBackoff: } oq.backingOff.Store(false) } diff --git a/federationsender/queue/queue.go b/federationsender/queue/queue.go index 88d8c61ae..6c7fca54e 100644 --- a/federationsender/queue/queue.go +++ b/federationsender/queue/queue.go @@ -85,17 +85,17 @@ func (oqs *OutgoingQueues) getQueue(destination gomatrixserverlib.ServerName) *d oq := oqs.queues[destination] if oq == nil { oq = &destinationQueue{ - db: oqs.db, - rsAPI: oqs.rsAPI, - origin: oqs.origin, - destination: destination, - client: oqs.client, - statistics: oqs.statistics.ForServer(destination), - incomingEDUs: make(chan *gomatrixserverlib.EDU, 128), - incomingInvites: make(chan *gomatrixserverlib.InviteV2Request, 128), - notifyPDUs: make(chan bool, 128), - interruptBackoffCh: make(chan bool), - signing: oqs.signing, + db: oqs.db, + rsAPI: oqs.rsAPI, + origin: oqs.origin, + destination: destination, + client: oqs.client, + statistics: oqs.statistics.ForServer(destination), + incomingEDUs: make(chan *gomatrixserverlib.EDU, 128), + incomingInvites: make(chan *gomatrixserverlib.InviteV2Request, 128), + notifyPDUs: make(chan bool, 128), + interruptBackoff: make(chan bool), + signing: oqs.signing, } oqs.queues[destination] = oq }