mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
explicitly cast jobsDisabled as Boolean
This commit is contained in:
11
app.js
11
app.js
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user