|
|
|
@ -41,9 +41,21 @@ function setupDebugging() {
|
|
|
|
|
var pool = [];
|
|
|
|
|
var free = [];
|
|
|
|
|
|
|
|
|
|
Minifier.maxThreads = os.cpus().length - 1;
|
|
|
|
|
var maxThreads = 0;
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(Minifier, 'maxThreads', {
|
|
|
|
|
get: function () {
|
|
|
|
|
return maxThreads;
|
|
|
|
|
},
|
|
|
|
|
set: function (val) {
|
|
|
|
|
maxThreads = val;
|
|
|
|
|
winston.verbose('[minifier] utilizing a maximum of ' + maxThreads + ' additional threads');
|
|
|
|
|
},
|
|
|
|
|
configurable: true,
|
|
|
|
|
enumerable: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
winston.verbose('[minifier] utilizing a maximum of ' + Minifier.maxThreads + ' additional threads');
|
|
|
|
|
Minifier.maxThreads = os.cpus().length - 1;
|
|
|
|
|
|
|
|
|
|
Minifier.killAll = function () {
|
|
|
|
|
pool.forEach(function (child) {
|
|
|
|
|