From 4074445cbb45dc6ec132e67b7eac9f32dcfd53de Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 11 Jan 2018 09:04:18 -0500 Subject: Move worker into account tab --- worker/imap/worker.go | 9 ++------- worker/types/messages.go | 2 +- worker/worker.go | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'worker') diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 14e4004c..080927df 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -18,13 +18,8 @@ func NewIMAPWorker() *IMAPWorker { } } -func (w *IMAPWorker) GetMessage() types.WorkerMessage { - select { - case msg := <-w.messages: - return msg - default: - return nil - } +func (w *IMAPWorker) GetMessages() chan types.WorkerMessage { + return w.messages } func (w *IMAPWorker) PostAction(msg types.WorkerMessage) { diff --git a/worker/types/messages.go b/worker/types/messages.go index 845bb86a..a4d8ddb3 100644 --- a/worker/types/messages.go +++ b/worker/types/messages.go @@ -33,7 +33,7 @@ type Ping struct { type Configure struct { Message - Config config.AccountConfig + Config *config.AccountConfig } type Connect struct { diff --git a/worker/worker.go b/worker/worker.go index da7928e9..c8ec6222 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -9,7 +9,7 @@ import ( ) type Worker interface { - GetMessage() types.WorkerMessage + GetMessages() chan types.WorkerMessage PostAction(types.WorkerMessage) Run() } -- cgit