Add .gitignore to exclude all node packages and lock files
This commit is contained in:
Generated
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveConcurrency = void 0;
|
||||
const get_cpu_count_1 = require("./get-cpu-count");
|
||||
const resolveConcurrency = (userPreference) => {
|
||||
const maxCpus = (0, get_cpu_count_1.getCpuCount)();
|
||||
if (userPreference === null) {
|
||||
return Math.round(Math.min(8, Math.max(1, maxCpus / 2)));
|
||||
}
|
||||
const min = 1;
|
||||
let rounded;
|
||||
if (typeof userPreference === 'string') {
|
||||
const percentage = parseInt(userPreference.slice(0, -1), 10);
|
||||
rounded = Math.floor((percentage / 100) * maxCpus);
|
||||
}
|
||||
else {
|
||||
rounded = Math.floor(userPreference);
|
||||
}
|
||||
if (rounded > maxCpus) {
|
||||
throw new Error(`Maximum for --concurrency is ${maxCpus} (number of cores on this system)`);
|
||||
}
|
||||
if (rounded < min) {
|
||||
throw new Error(`Minimum for concurrency is ${min}.`);
|
||||
}
|
||||
return rounded;
|
||||
};
|
||||
exports.resolveConcurrency = resolveConcurrency;
|
||||
Reference in New Issue
Block a user