From 4f112c16dfac61deb128b48e9d516f78ab55fc95 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sun, 28 Feb 2021 13:22:17 +0100 Subject: Start IMAP connections in the background and use them on the go --- internal/imap/commando.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/imap/commando.go') diff --git a/internal/imap/commando.go b/internal/imap/commando.go index 1ba4ed3..2edbc58 100644 --- a/internal/imap/commando.go +++ b/internal/imap/commando.go @@ -50,11 +50,11 @@ func (cl *Client) startCommander() { cl.commander = &commander{cl, pipe, done} - for _, conn := range cl.connections { - if conn != nil { + go func() { + for conn := range cl.connChannel { go executioner(conn, pipe, done) } - } + }() } func (cl *Client) stopCommander() { -- cgit v1.2.3-70-g09d2