mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
remove uncessary checks in guest config upgrade
This commit is contained in:
@@ -305,17 +305,10 @@ Upgrade.upgradeRedis = function(callback) {
|
||||
}
|
||||
},
|
||||
function(next) {
|
||||
|
||||
thisSchemaDate = new Date(2013, 11, 11).getTime();
|
||||
if (schemaDate < thisSchemaDate) {
|
||||
updatesMade = true;
|
||||
|
||||
RDB.hmget('config', 'allowGuestSearching', function(err, value) {
|
||||
if(err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if(value[0] === null) {
|
||||
RDB.hset('config', 'allowGuestSearching', '0', function(err){
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -323,8 +316,6 @@ Upgrade.upgradeRedis = function(callback) {
|
||||
winston.info('[2013/12/11] Updated guest search config.');
|
||||
next();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
winston.info('[2013/12/11] Update to guest search skipped');
|
||||
next();
|
||||
@@ -379,12 +370,6 @@ Upgrade.upgradeMongo = function(callback) {
|
||||
if (schemaDate < thisSchemaDate) {
|
||||
updatesMade = true;
|
||||
|
||||
db.getObjectField('config', 'allowGuestSearching', function(err, value) {
|
||||
if(err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if(!value) {
|
||||
db.setObjectField('config', 'allowGuestSearching', '0', function(err){
|
||||
if (err) {
|
||||
return next(err);
|
||||
@@ -392,8 +377,6 @@ Upgrade.upgradeMongo = function(callback) {
|
||||
winston.info('[2013/12/11] Updated guest search config.');
|
||||
next();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
winston.info('[2013/12/11] Update to guest search skipped');
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user