mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
We don't really need Ch here do we
This commit is contained in:
parent
82d11484bc
commit
8bc9de2fe0
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue