Fix return type for RedisOptions.reconnectOnError

As seen in the source https://github.com/luin/ioredis/blob/cf18554c142f461b3ad7ff716df596d7d1615828/lib/redis/parser.js#L50 the return values for the `reconnectOnError` functions should include `1` and `2`.
This commit is contained in:
yperess
2018-05-15 12:16:24 -04:00
committed by GitHub
parent d96a4c4398
commit cab2b0c006
+5 -1
View File
@@ -798,7 +798,11 @@ declare namespace IORedis {
* Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
*/
retryStrategy?(times: number): number | false;
reconnectOnError?(error: Error): boolean;
/**
* 1/true means reconnect, 2 means reconnect and resend failed command. Returning false will ignore
* the error and do nothing.
*/
reconnectOnError?(error: Error): boolean | 1 | 2;
/**
* By default, if there is no active connection to the Redis server, commands are added to a queue
* and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means