explicitly cast jobsDisabled as Boolean

v1.18.x
Julian Lam 8 years ago
parent ce2bda0648
commit a48c914a16

@ -117,6 +117,17 @@ function loadConfig(callback) {
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') {
callback();
}

Loading…
Cancel
Save