We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getThreads()
1 parent 6b6c3f1 commit 7af2c57Copy full SHA for 7af2c57
1 file changed
lib/getThreads.js
@@ -2,13 +2,9 @@
2
3
const os = require('os');
4
5
-// eslint-disable-next-line unicorn/explicit-length-check
6
-const CPUS = os.cpus() && os.cpus().length;
7
-const THREADS = CPUS > 2 ? CPUS - 1 : 1;
8
-
9
-function getThreads(config) {
10
- const { threads } = config;
+const THREADS = Math.max(os.cpus().length - 1, 1);
11
+function getThreads({ threads }) {
12
switch (threads) {
13
case 'auto':
14
case -1:
0 commit comments