mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-01 00:27:50 +02:00
fix: #8474
make isPrimary and isCluster always booleans they were strings when using ./nodebb start and boolean if they were in config.json and started with node app.js
This commit is contained in:
@@ -39,9 +39,9 @@ const urlObject = url.parse(nconf.get('url'));
|
||||
const relativePath = urlObject.pathname !== '/' ? urlObject.pathname : '';
|
||||
nconf.set('relative_path', relativePath);
|
||||
|
||||
if (!nconf.get('isCluster')) {
|
||||
nconf.set('isPrimary', 'true');
|
||||
nconf.set('isCluster', 'true');
|
||||
if (nconf.get('isCluster') === undefined) {
|
||||
nconf.set('isPrimary', true);
|
||||
nconf.set('isCluster', true);
|
||||
}
|
||||
|
||||
const dbType = nconf.get('database');
|
||||
|
||||
@@ -8,7 +8,7 @@ var pubsub = require('../src/pubsub');
|
||||
|
||||
describe('pubsub', function () {
|
||||
it('should use the plain event emitter', function (done) {
|
||||
nconf.set('isCluster', 'false');
|
||||
nconf.set('isCluster', false);
|
||||
pubsub.reset();
|
||||
pubsub.on('testEvent', function (message) {
|
||||
assert.equal(message.foo, 1);
|
||||
@@ -21,7 +21,7 @@ describe('pubsub', function () {
|
||||
it('should use same event emitter', function (done) {
|
||||
pubsub.on('dummyEvent', function (message) {
|
||||
assert.equal(message.foo, 2);
|
||||
nconf.set('isCluster', 'true');
|
||||
nconf.set('isCluster', true);
|
||||
pubsub.removeAllListeners('dummyEvent');
|
||||
pubsub.reset();
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user