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:
Barış Soner Uşaklı
2018-06-06 19:55:15 -04:00
parent 779d03cf57
commit 0630915cad
2 changed files with 4 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ var async = require('async');
var db = require('../database');
var plugins = require('../plugins');
var Meta = require('../meta');
var pubsub = require('../pubsub');
var Settings = module.exports;
@@ -35,7 +36,7 @@ Settings.set = function (hash, values, quiet, callback) {
plugin: hash,
settings: values,
});
pubsub.publish('action:settings.set.' + hash, values);
Meta.reloadRequired = !quiet;
next();
},

View File

@@ -64,6 +64,8 @@ function loadConfig(configFile) {
}
});
nconf.stores.env.readOnly = true;
nconf.set('runJobs', nconf.get('isPrimary') && !nconf.get('jobsDisabled'));
}
function versionCheck() {