mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
when settings are saved publish it to all nodes
add runJobs value to nconf, only true on nodes that should run jobs ie isPrimary and jobs are not disabled
This commit is contained in:
@@ -5,6 +5,7 @@ var async = require('async');
|
|||||||
var db = require('../database');
|
var db = require('../database');
|
||||||
var plugins = require('../plugins');
|
var plugins = require('../plugins');
|
||||||
var Meta = require('../meta');
|
var Meta = require('../meta');
|
||||||
|
var pubsub = require('../pubsub');
|
||||||
|
|
||||||
var Settings = module.exports;
|
var Settings = module.exports;
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ Settings.set = function (hash, values, quiet, callback) {
|
|||||||
plugin: hash,
|
plugin: hash,
|
||||||
settings: values,
|
settings: values,
|
||||||
});
|
});
|
||||||
|
pubsub.publish('action:settings.set.' + hash, values);
|
||||||
Meta.reloadRequired = !quiet;
|
Meta.reloadRequired = !quiet;
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ function loadConfig(configFile) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
nconf.stores.env.readOnly = true;
|
nconf.stores.env.readOnly = true;
|
||||||
|
|
||||||
|
nconf.set('runJobs', nconf.get('isPrimary') && !nconf.get('jobsDisabled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function versionCheck() {
|
function versionCheck() {
|
||||||
|
|||||||
Reference in New Issue
Block a user