]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: Fix get_max_worker_count() to always have two runners
authorAndreas Schneider <asn@samba.org>
Fri, 19 Jun 2020 15:35:19 +0000 (17:35 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 19 Jun 2020 19:54:04 +0000 (19:54 +0000)
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

python/samba/tests/docs.py

index 5fb04ab4e2e7bf3b3130c23996c28da69423dce3..10339702a971c9d9b33912bc3c1b79bbc775aa33 100644 (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