From 9fe6b01f941d84d55e93b6b7f7014efb5fde4eac Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 2 Jul 2021 11:42:42 +0100 Subject: [PATCH] Reduce CPU usage, fix unit tests --- federationapi/routing/send.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 8192b0c12..27aabd7e3 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -294,6 +294,8 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res results[task.event.EventID()] = gomatrixserverlib.PDUResult{ Error: task.err.Error(), } + } else { + results[task.event.EventID()] = gomatrixserverlib.PDUResult{} } } @@ -309,6 +311,7 @@ func (t *inputWorker) run() { } defer t.running.Store(false) for { + <-t.input.wait() task, ok := t.input.pop() if !ok { return