From eb42429b725dfb98af2cdeb43eca211831e252ee Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 2 Jul 2021 11:45:52 +0100 Subject: [PATCH] Tweaks --- federationapi/routing/send.go | 1 - federationapi/routing/send_fifo.go | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 27aabd7e3..8262c6a88 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -311,7 +311,6 @@ func (t *inputWorker) run() { } defer t.running.Store(false) for { - <-t.input.wait() task, ok := t.input.pop() if !ok { return diff --git a/federationapi/routing/send_fifo.go b/federationapi/routing/send_fifo.go index 81335a8ac..d19afa13b 100644 --- a/federationapi/routing/send_fifo.go +++ b/federationapi/routing/send_fifo.go @@ -49,16 +49,3 @@ func (q *fifoQueue) pop() (*inputTask, bool) { } return frame, true } - -// wait returns a channel which can be used to detect when an -// item is waiting in the queue. -func (q *fifoQueue) wait() <-chan struct{} { - q.mutex.Lock() - defer q.mutex.Unlock() - if q.count > 0 && len(q.notifs) == 0 { - ch := make(chan struct{}) - close(ch) - return ch - } - return q.notifs -}