mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
ioredis: new option maxRetriesPerRequest
This commit is contained in:
11
types/ioredis/index.d.ts
vendored
11
types/ioredis/index.d.ts
vendored
@@ -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.
|
||||
|
||||
@@ -46,6 +46,7 @@ new Redis({
|
||||
password: 'auth',
|
||||
db: 0,
|
||||
retryStrategy() { return false; },
|
||||
maxRetriesPerRequest: 20,
|
||||
showFriendlyErrorStack: true,
|
||||
tls: {
|
||||
servername: 'tlsservername'
|
||||
|
||||
Reference in New Issue
Block a user