Merge pull request #28491 from dex4er/ioredis

ioredis: new option maxRetriesPerRequest
This commit is contained in:
Armando Aguirre
2018-08-29 11:25:22 -07:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -841,6 +841,17 @@ declare namespace IORedis {
* Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
*/
retryStrategy?(times: number): number | false;
/**
* By default, all pending commands will be flushed with an error every
* 20 retry attempts. That makes sure commands won't wait forever when
* the connection is down. You can change this behavior by setting
* `maxRetriesPerRequest`.
*
* Set maxRetriesPerRequest to `null` to disable this behavior, and
* every command will wait forever until the connection is alive again
* (which is the default behavior before ioredis v4).
*/
maxRetriesPerRequest?: number | null;
/**
* 1/true means reconnect, 2 means reconnect and resend failed command. Returning false will ignore
* the error and do nothing.
+1
View File
@@ -46,6 +46,7 @@ new Redis({
password: 'auth',
db: 0,
retryStrategy() { return false; },
maxRetriesPerRequest: 20,
showFriendlyErrorStack: true,
tls: {
servername: 'tlsservername'