Revert "worker: prevent deadlock by flooding worker.Messages channel"

This reverts commit 7473571159.

The commit has introduced a regression that lead to the pager not being
filled with content, thereby making reading mails impossible.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Moritz Poldrack 2022-09-20 00:36:31 +02:00 committed by Robin Jarry
parent f59ca5af36
commit ddca71bcfd

View file

@ -64,10 +64,7 @@ func (worker *Worker) PostMessage(msg WorkerMessage,
} else { } else {
logging.Debugf("PostMessage %T", msg) logging.Debugf("PostMessage %T", msg)
} }
// This one needs to be in a separate goroutine to prevent deadlocks
go func() {
worker.Messages <- msg worker.Messages <- msg
}()
if cb != nil { if cb != nil {
worker.messageCallbacks[msg.getId()] = cb worker.messageCallbacks[msg.getId()] = cb