summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-10-04 18:17:11 +0200
committerCarl Hetherington <cth@carlh.net>2019-10-04 18:17:11 +0200
commit73b57443261fbac9dd15885ebe1f9d9cd794980b (patch)
tree9c8fc82438150c333bf5dc31ef3dc0b95c2fa0cc
parent6267ed833aea3b54455cd7c14ddf13f998bd3f3b (diff)
Try to guess CPU count correctly.
-rwxr-xr-xcdist3
1 files changed, 2 insertions, 1 deletions
diff --git a/cdist b/cdist
index 0f7290e..f613ee2 100755
--- a/cdist
+++ b/cdist
@@ -30,6 +30,7 @@ import copy
import inspect
import getpass
import shlex
+import multiprocessing
TEMPORARY_DIRECTORY = '/var/tmp'
@@ -109,7 +110,7 @@ class Config:
BoolOption('docker_no_user'),
Option('docker_hub_repository'),
Option('flatpak_state_dir'),
- Option('parallel', 4) ]
+ Option('parallel', multiprocessing.cpu_count()) ]
try:
f = open('%s/.config/cdist' % os.path.expanduser('~'), 'r')