From 9546a64d468af51648349c775ab2f74ed2db046d Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Mon, 30 Mar 2020 18:04:52 +0000 Subject: [PATCH] vimPlugins: Add --proc flag to update script. This is based on discussion in #83008 and replaces it. --- pkgs/misc/vim-plugins/update.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/misc/vim-plugins/update.py b/pkgs/misc/vim-plugins/update.py index bbeef0889f42..0055e8eccbce 100755 --- a/pkgs/misc/vim-plugins/update.py +++ b/pkgs/misc/vim-plugins/update.py @@ -477,6 +477,14 @@ def parse_args(): default=DEFAULT_OUT, help="Filename to save generated nix code", ) + parser.add_argument( + "--proc", + "-p", + dest="proc", + type=int, + default=30, + help="Number of concurrent processes to spawn.", + ) return parser.parse_args() @@ -491,9 +499,7 @@ def main() -> None: prefetch_with_cache = functools.partial(prefetch, cache=cache) try: - # synchronous variant for debugging - # results = list(map(prefetch_with_cache, plugin_names)) - pool = Pool(processes=30) + pool = Pool(processes=args.proc) results = pool.map(prefetch_with_cache, plugin_names) finally: cache.store()