aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorArun Isaac2023-02-13 17:35:13 +0000
committerArun Isaac2023-02-13 17:36:09 +0000
commit283e7f08701ed80cdfeb8773df38c0c30227a10c (patch)
tree0d54d65f4bf120d9841251f0c41d6f0e97137bec /scripts
parent152d0fb36b76b7c68d8202ba3665617bad3e684b (diff)
downloadgenenetwork3-283e7f08701ed80cdfeb8773df38c0c30227a10c.tar.gz
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/index-genenetwork2
1 files changed, 1 insertions, 1 deletions
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()