diff --git a/worker/types/worker.go b/worker/types/worker.go index 897d6654..ba925d71 100644 --- a/worker/types/worker.go +++ b/worker/types/worker.go @@ -106,14 +106,13 @@ func (worker *Worker) processQueue() { // from the same goroutine that the worker runs in or deadlocks may occur func (worker *Worker) PostAction(msg WorkerMessage, cb func(msg WorkerMessage)) { worker.setId(msg) - // write to actions channel without blocking - worker.queue(msg) - if cb != nil { worker.Lock() worker.actionCallbacks[msg.getId()] = cb worker.Unlock() } + // write to actions channel without blocking + worker.queue(msg) } var WorkerMessages = make(chan WorkerMessage, 50)