From 4267c6fd0a62bb7083639ae07a9b9d02907c0f0d Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 3 Jul 2020 11:26:35 +0100 Subject: [PATCH] Review comments --- federationsender/queue/destinationqueue.go | 6 ++++-- federationsender/queue/queue.go | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/federationsender/queue/destinationqueue.go b/federationsender/queue/destinationqueue.go index decba859c..e2314ebbe 100644 --- a/federationsender/queue/destinationqueue.go +++ b/federationsender/queue/destinationqueue.go @@ -251,8 +251,10 @@ func (oq *destinationQueue) backgroundSend() { oq.cleanPendingInvites() return } else { - // We haven't been told to give up terminally yet - // but we still need to wake up the next iteration. + // We haven't been told to give up terminally yet but we still have + // PDUs waiting to be sent. By sending a message into the wake chan, + // the next loop iteration will try processing these PDUs again, + // subject to the backoff. oq.wakeServerCh <- true } } else if transaction { diff --git a/federationsender/queue/queue.go b/federationsender/queue/queue.go index f5d50b20b..bc7ec0f93 100644 --- a/federationsender/queue/queue.go +++ b/federationsender/queue/queue.go @@ -61,10 +61,12 @@ func NewOutgoingQueues( queues: map[gomatrixserverlib.ServerName]*destinationQueue{}, } // Look up which servers we have pending items for and then rehydrate those queues. - if serverNames, err := db.GetPendingServerNames(context.TODO()); err == nil { + if serverNames, err := db.GetPendingServerNames(context.Background()); err == nil { for _, serverName := range serverNames { queues.getQueue(serverName).wakeQueueIfNeeded() } + } else { + log.WithError(err).Error("Failed to get server names for destination queue hydration") } return queues }