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