From 283e7f08701ed80cdfeb8773df38c0c30227a10c Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 13 Feb 2023 17:35:13 +0000 Subject: scripts: Fallback to 1 worker when indexing. * scripts/index-genenetwork (worker_queue): Set default number of workers to 1 if the number of CPUs cannot be determined. --- scripts/index-genenetwork | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/index-genenetwork b/scripts/index-genenetwork index 7600f90..b92fa5e 100755 --- a/scripts/index-genenetwork +++ b/scripts/index-genenetwork @@ -283,7 +283,7 @@ def group(generator: Iterable, chunk_size: int) -> Iterable: @contextlib.contextmanager -def worker_queue(number_of_workers: int = os.cpu_count()) -> Generator: +def worker_queue(number_of_workers: int = os.cpu_count() or 1) -> Generator: """Manage a pool of worker processes returning a function to spawn them.""" processes: deque = deque() -- cgit v1.2.3