diff options
author | Arun Isaac | 2023-02-13 17:35:13 +0000 |
---|---|---|
committer | Arun Isaac | 2023-02-13 17:36:09 +0000 |
commit | 283e7f08701ed80cdfeb8773df38c0c30227a10c (patch) | |
tree | 0d54d65f4bf120d9841251f0c41d6f0e97137bec | |
parent | 152d0fb36b76b7c68d8202ba3665617bad3e684b (diff) | |
download | genenetwork3-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.
-rwxr-xr-x | scripts/index-genenetwork | 2 |
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() |