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

@@ -308,7 +308,7 @@ postgresModule.createSessionStore = function (options, callback) {
const store = new sessionStore({
pool: db,
ttl: meta.getSessionTTLSeconds(),
pruneSessionInterval: nconf.get('isPrimary') === 'true' ? 60 : false,
pruneSessionInterval: nconf.get('isPrimary') ? 60 : false,
});
callback(null, store);
}
@@ -317,7 +317,7 @@ postgresModule.createSessionStore = function (options, callback) {
if (err) {
return callback(err);
}
if (nconf.get('isPrimary') !== 'true') {
if (!nconf.get('isPrimary')) {
return done(db);
}
db.query(`