See http://stackoverflow.com/a/1408476
This commit is contained in:
Markus Unterwaditzer 2014-04-29 19:27:44 +02:00
parent 89cc942da1
commit a886d2d42d

View file

@ -234,14 +234,12 @@ def _main(env, file_cfg):
if processes == 1:
cli_logger.debug('Not using multiprocessing.')
_map = map
map(_sync_collection, actions)
else:
cli_logger.debug('Using multiprocessing.')
from multiprocessing import Pool
p = Pool(processes=general.get('processes', 0) or len(actions))
_map = p.map
_map(_sync_collection, actions)
p.map_async(_sync_collection, actions).get(10**9)
app.register_command('sync', sync_command)
app()