aboutsummaryrefslogtreecommitdiffstats
path: root/worker/mbox
diff options
context:
space:
mode:
Diffstat (limited to 'worker/mbox')
-rw-r--r--worker/mbox/worker.go25
1 files changed, 11 insertions, 14 deletions
diff --git a/worker/mbox/worker.go b/worker/mbox/worker.go
index ab16f91e..6114870e 100644
--- a/worker/mbox/worker.go
+++ b/worker/mbox/worker.go
@@ -363,20 +363,17 @@ func (w *mboxWorker) handleMessage(msg types.WorkerMessage) error {
}
func (w *mboxWorker) Run() {
- for {
- select {
- case msg := <-w.worker.Actions:
- msg = w.worker.ProcessAction(msg)
- if err := w.handleMessage(msg); err == errUnsupported {
- w.worker.PostMessage(&types.Unsupported{
- Message: types.RespondTo(msg),
- }, nil)
- } else if err != nil {
- w.worker.PostMessage(&types.Error{
- Message: types.RespondTo(msg),
- Error: err,
- }, nil)
- }
+ for msg := range w.worker.Actions {
+ msg = w.worker.ProcessAction(msg)
+ if err := w.handleMessage(msg); err == errUnsupported {
+ w.worker.PostMessage(&types.Unsupported{
+ Message: types.RespondTo(msg),
+ }, nil)
+ } else if err != nil {
+ w.worker.PostMessage(&types.Error{
+ Message: types.RespondTo(msg),
+ Error: err,
+ }, nil)
}
}
}