aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--worker/types/worker.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/worker/types/worker.go b/worker/types/worker.go
index ba396aa3..5a964f2f 100644
--- a/worker/types/worker.go
+++ b/worker/types/worker.go
@@ -64,7 +64,10 @@ func (worker *Worker) PostMessage(msg WorkerMessage,
} else {
logging.Debugf("PostMessage %T", msg)
}
- worker.Messages <- msg
+ // This one needs to be in a separate goroutine to prevent deadlocks
+ go func() {
+ worker.Messages <- msg
+ }()
if cb != nil {
worker.messageCallbacks[msg.getId()] = cb