diff --git a/docs/api.rst b/docs/api.rst index 86ad02d..10474ef 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -21,7 +21,7 @@ General Section next sync. The data is needed to determine whether a new item means it has been added on one side or deleted on the other. -- ``processes``: Optional, defines the amount of maximal connections to use for +- ``processes``: Optional, defines the maximal amount of threads to use for syncing. By default there is no limit, which means vdirsyncer will try to open a connection for each collection to be synced. The value ``0`` is ignored. Setting this to ``1`` will only synchronize one collection at a @@ -32,6 +32,12 @@ General Section Raspberry Pi is so slow that multiple connections don't help much, since the CPU and not the network is the bottleneck. + .. note:: + + Due to restrictions in Python's threading module, setting ``processes`` + to anything else than ``1`` will mean that you can't properly abort the + program with ``^C`` anymore. + .. _pair_config: Pair Section diff --git a/vdirsyncer/cli.py b/vdirsyncer/cli.py index e82dea0..6078495 100644 --- a/vdirsyncer/cli.py +++ b/vdirsyncer/cli.py @@ -357,9 +357,7 @@ def _create_app(): from multiprocessing.dummy import Pool p = Pool(processes=general.get('processes', 0) or len(actions)) - # We have to use map_async.get(large_value) instead of map or - # map_async.get() because otherwise ^C wouldn't work properly. - rv = p.map_async(_sync_collection, actions).get(10**9) + rv = p.imap_unordered(_sync_collection, actions) if not all(rv): sys.exit(1)