1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

python: Fix get_max_worker_count() to always have two runners

Thanks to Jim Brown.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun 19 19:54:04 UTC 2020 on sn-devel-184
This commit is contained in:
Andreas Schneider
2020-06-19 17:35:19 +02:00
committed by Andreas Schneider
parent e478470f20
commit 27709178e0

View File

@ -57,12 +57,12 @@ def get_max_worker_count():
cpu_count = multiprocessing.cpu_count()
# Always run two processes in parallel
if cpu_count <= 2:
if cpu_count < 2:
return 2
max_workers = int(cpu_count / 2)
if max_workers < 1:
return 1
if max_workers < 2:
return 2
return max_workers