vault-high-availability
Advanced tools
Comparing version 1.0.64 to 1.0.65
@@ -19,3 +19,2 @@ /** | ||
this.addressResolver = new vaultLeaderResolver(vaultAddress); | ||
//this.addressResolver.findActiveIp(); | ||
}catch(err){ | ||
@@ -26,2 +25,3 @@ logger.error("An error happened while trying to resolve the leader",err); | ||
setStrategey(this.addressResolver); | ||
return this.addressResolver.findActiveIp(); | ||
} | ||
@@ -43,3 +43,3 @@ | ||
logger.debug("Going to find the vault leader task"); | ||
return addressResolver.findActiveIp(); | ||
addressResolver.findActiveIp(); | ||
}); | ||
@@ -46,0 +46,0 @@ |
{ | ||
"name": "vault-high-availability", | ||
"version": "1.0.64", | ||
"version": "1.0.65", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
25
t.js
@@ -5,17 +5,26 @@ /** | ||
var request; | ||
var vaultHighAvailability = require('./index')("http://demo7061723.mockable.io"); | ||
var request = vaultHighAvailability.request; | ||
vaultHighAvailability.then(function (object) { | ||
request = object.request; | ||
var options = { | ||
method: "GET", | ||
url :"http://demo7061723.mockable.io/v1/sys/leader", | ||
retryStrategy: vaultHighAvailability.networkOrHttpErrorTriggerResolveDNS, | ||
addressResolver: vaultHighAvailability.replaceDnsWithIp | ||
} | ||
var options = { | ||
method: "GET", | ||
url :"http://demo7061723.mockable.io/v1/sys/leader", | ||
retryStrategy: vaultHighAvailability.networkOrHttpErrorTriggerResolveDNS, | ||
addressResolver: vaultHighAvailability.replaceDnsWithIp | ||
} | ||
request(options,function (error,response,body) { | ||
console.log(response.body); | ||
}) | ||
request(options,function (error,response,body) { | ||
}).catch(function (error) { | ||
console.log(error); | ||
}) | ||
@@ -107,3 +107,3 @@ 'use strict'; | ||
log.error("An error happened while trying to get vault leader", err); | ||
return generalReject() | ||
return generalReject("An error happened while trying to get vault leader") | ||
}) | ||
@@ -200,4 +200,2 @@ }; | ||
url = urlLib.format(urlObject); | ||
log.debug("URL after resolving:" + url); | ||
return url | ||
@@ -207,11 +205,7 @@ } 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).then(function () { | ||
log.debug("Found the ip, going to replace the url with the ip:" + this.ip); | ||
var urlObject = urlLib.parse(url); | ||
urlObject.host = undefined; | ||
urlObject.hostname = this.ip; | ||
url = urlLib.format(urlObject); | ||
log.debug("URL after resolving:" + url); | ||
return url | ||
}) | ||
} | ||
log.debug("URL after resolving:" + url); | ||
return url | ||
@@ -218,0 +212,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38055
708