Merge branch 'master' into develop

v1.18.x
Julian Lam 8 years ago
commit 87e02b264c

@ -117,6 +117,17 @@ function loadConfig(callback) {
nconf.set('url_parsed', url.parse(nconf.get('url'))); nconf.set('url_parsed', url.parse(nconf.get('url')));
} }
// Explicitly cast 'jobsDisabled' as Bool
var castAsBool = ['jobsDisabled'];
nconf.stores.env.readOnly = false;
castAsBool.forEach(function (prop) {
var value = nconf.get(prop);
if (value) {
nconf.set(prop, typeof value === 'boolean' ? value : String(value).toLowerCase() === 'true');
}
});
nconf.stores.env.readOnly = true;
if (typeof callback === 'function') { if (typeof callback === 'function') {
callback(); callback();
} }

@ -45,6 +45,9 @@ exports.build = function build(targets, callback) {
exports.buildTargets = function (targets, callback) { exports.buildTargets = function (targets, callback) {
var cacheBuster = require('./cacheBuster'); var cacheBuster = require('./cacheBuster');
var meta = require('../meta'); var meta = require('../meta');
var numCpus = require('os').cpus().length;
var strategy = (targets.length > 1 && numCpus > 1);
buildStart = buildStart || Date.now(); buildStart = buildStart || Date.now();
var step = function (startTime, target, next, err) { var step = function (startTime, target, next, err) {
@ -56,7 +59,13 @@ exports.buildTargets = function (targets, callback) {
next(); next();
}; };
async.parallel([ if (strategy) {
winston.verbose('[build] Utilising multiple cores/processes');
} else {
winston.verbose('[build] Utilising single-core');
}
async[strategy ? 'parallel' : 'series']([
function (next) { function (next) {
if (targets.indexOf('js') !== -1) { if (targets.indexOf('js') !== -1) {
winston.info('[build] Building javascript'); winston.info('[build] Building javascript');

Loading…
Cancel
Save