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:
Barış Soner Uşaklı
2020-07-07 20:13:14 -04:00
parent 8853cd1aa5
commit c2ca02dfc7
10 changed files with 34 additions and 36 deletions

View File

@@ -27,12 +27,14 @@ Sockets.init = function (server) {
path: nconf.get('relative_path') + '/socket.io',
});
if (nconf.get('singleHostCluster')) {
io.adapter(require('./single-host-cluster'));
} else if (nconf.get('redis')) {
io.adapter(require('../database/redis').socketAdapter());
} else {
io.adapter(db.socketAdapter());
if (nconf.get('isCluster')) {
if (nconf.get('singleHostCluster')) {
io.adapter(require('./single-host-cluster'));
} else if (nconf.get('redis')) {
io.adapter(require('../database/redis').socketAdapter());
} else {
io.adapter(db.socketAdapter());
}
}
io.use(socketioWildcard);