mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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:
|
if processes == 1:
|
||||||
cli_logger.debug('Not using multiprocessing.')
|
cli_logger.debug('Not using multiprocessing.')
|
||||||
_map = map
|
map(_sync_collection, actions)
|
||||||
else:
|
else:
|
||||||
cli_logger.debug('Using multiprocessing.')
|
cli_logger.debug('Using multiprocessing.')
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
p = Pool(processes=general.get('processes', 0) or len(actions))
|
p = Pool(processes=general.get('processes', 0) or len(actions))
|
||||||
_map = p.map
|
p.map_async(_sync_collection, actions).get(10**9)
|
||||||
|
|
||||||
_map(_sync_collection, actions)
|
|
||||||
|
|
||||||
app.register_command('sync', sync_command)
|
app.register_command('sync', sync_command)
|
||||||
app()
|
app()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue