vault-high-availability
Advanced tools
Comparing version 1.0.26 to 1.0.27
@@ -19,3 +19,3 @@ /** | ||
this.addressResolver = new vaultLeaderResolver(vaultAddress); | ||
setStrategey(this.addressResolver, callback); | ||
setStrategey(this.addressResolver); | ||
} | ||
@@ -30,7 +30,7 @@ | ||
var setStrategey = function (addressResolver, callback) { | ||
var setStrategey = function (addressResolver) { | ||
logger.debug("Set strategey --> findActiveIp"); | ||
this.networkOrHttpErrorTriggerResolveDNS = NetworkOrHttpErrorTriggerResolveDNS(request.RetryStrategies.HTTPOrNetworkError, function () { | ||
logger.debug("Going to find the vault leader task"); | ||
addressResolver.findActiveIp(callback); | ||
addressResolver.findActiveIp(); | ||
}); | ||
@@ -37,0 +37,0 @@ |
{ | ||
"name": "vault-high-availability", | ||
"version": "1.0.26", | ||
"version": "1.0.27", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,3 +15,3 @@ 'use strict'; | ||
var findActiveIp = function (callback) { | ||
var findActiveIp = function () { | ||
log.info("will look for active ip only if isResolving is false"); | ||
@@ -33,3 +33,2 @@ if (!this.isResolving) { | ||
that.isResolving = false; | ||
return callback(); | ||
} | ||
@@ -70,14 +69,2 @@ }; | ||
log.info("active node set", id, new Date(), newIp); | ||
log.debug("Going to call the callback function..."); | ||
try { | ||
setTimeout(function () { | ||
log.debug("Got timeout after 1 sec..., going to call local callback"); | ||
return function () { | ||
log.error("Succeed to find the leader but there is an issue with calling callback function"); | ||
} | ||
},1000); | ||
return callback(); | ||
}catch(err){ | ||
log.error("An error happened while trying to call callback function",err); | ||
} | ||
} else { | ||
@@ -108,3 +95,3 @@ log.info("No active node was found."); | ||
} else { | ||
return callback() | ||
log.debug("No need to find the leader..."); | ||
} | ||
@@ -121,4 +108,3 @@ | ||
} else { // in case dns resolving failed on startup we still want to find the active. otherwise it will wait until the first failure. | ||
findActiveIp.call(this, function () { | ||
}); | ||
findActiveIp.call(this); | ||
} | ||
@@ -125,0 +111,0 @@ return url |
31026
595