Added Redis retry_strategy

Most of the ClientOpts that have to do with reconnecting have been
deprecated in favor of the `retry_strategy` property. The
DefinitelyTyped repo is outdated and is missing the retry_strategy
property. See the docs at https://github.com/NodeRedis/node_redis.

The following options of ClientOpts are deprecated in favor of
retry_strategy:
- retry_max_delay
- connect_timeout
- max_attempts
This commit is contained in:
Dani Hodovic
2016-07-25 20:57:50 +02:00
parent c42b2ba16c
commit 97883bac0d
+5
View File
@@ -34,6 +34,10 @@ declare module "redis" {
versions: number[];
}
interface RetryStrategy {
(options: {error: Error, total_retry_time: number, times_connected: number, attempt: number}): number;
}
export interface ClientOpts {
parser?: string;
return_buffers?: boolean;
@@ -50,6 +54,7 @@ declare module "redis" {
family?: string;
command_queue_high_water?: number;
command_queue_low_water?: number;
retry_strategy?: RetryStrategy;
}
export interface RedisClient extends NodeJS.EventEmitter {