Check blacklist properly

This commit is contained in:
Neil Alexander 2021-02-17 15:01:07 +00:00
parent db78ec73e8
commit 7cf4daa210
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -148,13 +148,13 @@ type queuedEDU struct {
} }
func (oqs *OutgoingQueues) getQueue(destination gomatrixserverlib.ServerName) *destinationQueue { func (oqs *OutgoingQueues) getQueue(destination gomatrixserverlib.ServerName) *destinationQueue {
if _, blacklisted := oqs.statistics.ForServer(destination).BackoffInfo(); blacklisted { if oqs.statistics.ForServer(destination).Blacklisted() {
return nil return nil
} }
oqs.queuesMutex.Lock() oqs.queuesMutex.Lock()
defer oqs.queuesMutex.Unlock() defer oqs.queuesMutex.Unlock()
oq := oqs.queues[destination] oq, ok := oqs.queues[destination]
if oq == nil { if !ok {
destinationQueueTotal.Inc() destinationQueueTotal.Inc()
oq = &destinationQueue{ oq = &destinationQueue{
queues: oqs, queues: oqs,