vault-high-availability

1.0.74 • Public • Published

In order to make sure that your request going to vault leader node, you can use these package instead of request. This Package is extend of requestRetry package with an option to replace the dns with ip.

HOW TO USE:

1- replace request package with:

var vaultHighAvailability = require('vault-high-availability')(server_address);
var request = vaultHighAvailability.request;

2- In your request option add these lines:

var options:{
..
..
time: true,
maxAttempts: process.env.MAX_ATTEMPT_RETRY || defaultRetryTimes,   // (default) try 5 times
retryDelay: process.env.RETRY_DELAY || 500,  // (default) wait for 5s before trying again
retryStrategy: vaultHighAvailability.networkOrHttpErrorTriggerResolveDNS,
addressResolver: vaultHighAvailability.replaceDnsWithIp
}

This will handle network Or Http Error & will replace the dns with the leader ip

Readme

Keywords

none

Package Sidebar

Install

npm i vault-high-availability

Weekly Downloads

0

Version

1.0.74

License

ISC

Last publish

Collaborators

  • hanymhajna