diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2023-06-05 13:05:10 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2023-06-05 13:05:10 +0200 |
commit | 3dfbd4d089c9181f8980d530933a47114b8c5656 (patch) | |
tree | a4bada4230e1b41855f178d25d967cc8e5a2aabb /internal/imap/imap.go | |
parent | 980e34f491cd1f00609ec81a7f113185b92a62dd (diff) | |
download | feed2imap-go-3dfbd4d089c9181f8980d530933a47114b8c5656.tar.gz feed2imap-go-3dfbd4d089c9181f8980d530933a47114b8c5656.tar.bz2 feed2imap-go-3dfbd4d089c9181f8980d530933a47114b8c5656.zip |
IMAP client does not need to know about max number of connections
Diffstat (limited to 'internal/imap/imap.go')
-rw-r--r-- | internal/imap/imap.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/imap/imap.go b/internal/imap/imap.go index 80a37a1..1179f3d 100644 --- a/internal/imap/imap.go +++ b/internal/imap/imap.go @@ -7,10 +7,10 @@ import ( "github.com/Necoro/feed2imap-go/pkg/log" ) -func Connect(url config.Url, maxConnections int) (*Client, error) { +func Connect(url config.Url, numConnections int) (*Client, error) { var err error - client := newClient(maxConnections) + client := newClient() client.host = url.Host defer func() { if err != nil { @@ -41,7 +41,7 @@ func Connect(url config.Url, maxConnections int) (*Client, error) { } // the other connections - for i := 1; i < client.maxConnections; i++ { + for i := 1; i < numConnections; i++ { go func(id int) { if _, err := client.connect(url); err != nil { // explicitly new var 'err', b/c these are now harmless log.Warnf("connecting #%d: %s", id, err) |