remove uncessary checks in guest config upgrade

This commit is contained in:
akhoury
2013-12-12 22:50:49 -05:00
parent b89cf6f480
commit 3ad98f3783

View File

@@ -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();