Don't queue in memory for blacklisted destinations
This commit is contained in:
parent
68a3b3e3fa
commit
558bfa8b06
|
@ -84,6 +84,9 @@ func (oq *destinationQueue) sendEvent(event *gomatrixserverlib.HeaderedEvent, re
|
||||||
log.WithError(err).Errorf("failed to associate PDU %q with destination %q", event.EventID(), oq.destination)
|
log.WithError(err).Errorf("failed to associate PDU %q with destination %q", event.EventID(), oq.destination)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Check if the destination is blacklisted. If it isn't then wake
|
||||||
|
// up the queue.
|
||||||
|
if !oq.statistics.Blacklisted() {
|
||||||
// If there's room in memory to hold the event then add it to the
|
// If there's room in memory to hold the event then add it to the
|
||||||
// list.
|
// list.
|
||||||
oq.pendingMutex.Lock()
|
oq.pendingMutex.Lock()
|
||||||
|
@ -94,9 +97,6 @@ func (oq *destinationQueue) sendEvent(event *gomatrixserverlib.HeaderedEvent, re
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
oq.pendingMutex.Unlock()
|
oq.pendingMutex.Unlock()
|
||||||
// Check if the destination is blacklisted. If it isn't then wake
|
|
||||||
// up the queue.
|
|
||||||
if !oq.statistics.Blacklisted() {
|
|
||||||
// Wake up the queue if it's asleep.
|
// Wake up the queue if it's asleep.
|
||||||
oq.wakeQueueIfNeeded()
|
oq.wakeQueueIfNeeded()
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in a new issue