fix proxy state loading bug when key not present

This commit is contained in:
Jerry Brady 2014-04-11 13:24:12 +00:00
parent 201d02d10b
commit b9891c8624
1 changed files with 6 additions and 2 deletions

View File

@ -210,12 +210,16 @@ module.exports = function(logger){
redisClient.on('ready', function(){
redisClient.hgetall("proxyState", function(error, obj) {
if (error) {
proxyState = {};
logger.debug(logSystem, logComponent, logSubCat, 'No last proxy state found in redis');
}
else {
if (obj != null)
{
proxyState = obj;
logger.debug(logSystem, logComponent, logSubCat, 'Last proxy state loaded from redis');
}
}
//
// Setup proxySwitch object to control proxy operations from configuration and any restored