Reduce CPU usage, fix unit tests

This commit is contained in:
Neil Alexander 2021-07-02 11:42:42 +01:00
parent 6582b639f0
commit 9fe6b01f94
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -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