You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/10/29 21:55:44 UTC
incubator-ponymail git commit: import-mbox.py should not start more
threads than there are files
Repository: incubator-ponymail
Updated Branches:
refs/heads/master f7d84ede0 -> 6a8e2ce83
import-mbox.py should not start more threads than there are files
This fixes #209
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/6a8e2ce8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/6a8e2ce8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/6a8e2ce8
Branch: refs/heads/master
Commit: 6a8e2ce83cfc298fa1d19a5bb4de3d194e02be78
Parents: f7d84ed
Author: Sebb <se...@apache.org>
Authored: Sat Oct 29 22:55:01 2016 +0100
Committer: Sebb <se...@apache.org>
Committed: Sat Oct 29 22:55:01 2016 +0100
----------------------------------------------------------------------
tools/import-mbox.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6a8e2ce8/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index c559bcb..ae505bf 100644
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -614,7 +614,8 @@ elif source[0] == "i":
lists.append([uids, listname, imap4])
threads = []
-cc = int( multiprocessing.cpu_count() / 2) + 1
+# Don't start more threads than there are lists
+cc = min(len(lists), int( multiprocessing.cpu_count() / 2) + 1)
print("Starting up to %u threads to fetch the %u %s lists" % (cc, len(lists), project))
for i in range(1,cc+1):
t = SlurpThread()