mirror of https://github.com/BTCPrivate/z-nomp.git
fix proxy state loading bug when key not present
This commit is contained in:
parent
b9891c8624
commit
5f6b09a877
|
@ -209,16 +209,12 @@ module.exports = function(logger){
|
||||||
var redisClient = redis.createClient(6379, "localhost")
|
var redisClient = redis.createClient(6379, "localhost")
|
||||||
redisClient.on('ready', function(){
|
redisClient.on('ready', function(){
|
||||||
redisClient.hgetall("proxyState", function(error, obj) {
|
redisClient.hgetall("proxyState", function(error, obj) {
|
||||||
if (error) {
|
if (error || obj == null) {
|
||||||
proxyState = {};
|
|
||||||
logger.debug(logSystem, logComponent, logSubCat, 'No last proxy state found in redis');
|
logger.debug(logSystem, logComponent, logSubCat, 'No last proxy state found in redis');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (obj != null)
|
proxyState = obj;
|
||||||
{
|
logger.debug(logSystem, logComponent, logSubCat, 'Last proxy state loaded from redis');
|
||||||
proxyState = obj;
|
|
||||||
logger.debug(logSystem, logComponent, logSubCat, 'Last proxy state loaded from redis');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue