From c44e94d64a3cb878883417529e0ad25bf90d6b6a Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Sun, 6 Mar 2011 10:20:14 +0100 Subject: [PATCH] Set maxconnections default to 2 Multithreading speeds up account syncing a lot and the offlineimap defaults are very conservative. Let's make it use 2 IMAP connections by default to gain some of the benefits that offlineimap offers. Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap.conf | 2 +- offlineimap/init.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/offlineimap.conf b/offlineimap.conf index d3be8be..cf731a4 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -341,7 +341,7 @@ remoteuser = username # cases, it may slow things down. The safe answer is 1. You should # probably never set it to a value more than 5. -maxconnections = 1 +maxconnections = 2 # OfflineIMAP normally closes IMAP server connections between refreshes if # the global option autorefresh is specified. If you wish it to keep the diff --git a/offlineimap/init.py b/offlineimap/init.py index 8aebb23..8029470 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -295,8 +295,9 @@ class OfflineImap: remoterepos = None localrepos = None - threadutil.initInstanceLimit("ACCOUNTLIMIT", - config.getdefaultint("general", "maxsyncaccounts", 1)) + threadutil.initInstanceLimit('ACCOUNTLIMIT', + config.getdefaultint('general', + 'maxsyncaccounts', 1)) for reposname in config.getsectionlist('Repository'): for instancename in ["FOLDER_" + reposname, @@ -305,7 +306,8 @@ class OfflineImap: threadutil.initInstanceLimit(instancename, 1) else: threadutil.initInstanceLimit(instancename, - config.getdefaultint('Repository ' + reposname, "maxconnections", 1)) + config.getdefaultint('Repository ' + reposname, + 'maxconnections', 2)) siglisteners = [] def sig_handler(signum, frame): if signum == signal.SIGUSR1: