mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-03 10:25:51 +00:00
parent
89cc942da1
commit
a886d2d42d
1 changed files with 2 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue