mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
Correct cluster options type to match what's actually happening within ioredis. Non-Numbers can be returned to end the retry loop
This commit is contained in:
Vendored
+2
-1
@@ -10,6 +10,7 @@
|
||||
// Dmitry Motovilov <https://github.com/funthing>
|
||||
// Oleg Repin <https://github.com/iamolegga>
|
||||
// Ting-Wai To <https://github.com/tingwai-to>
|
||||
// Alex Petty <https://github.com/pettyalex>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -972,7 +973,7 @@ declare namespace IORedis {
|
||||
}
|
||||
|
||||
interface ClusterOptions {
|
||||
clusterRetryStrategy?(times: number): number;
|
||||
clusterRetryStrategy?(times: number): number | null;
|
||||
enableOfflineQueue?: boolean;
|
||||
enableReadyCheck?: boolean;
|
||||
scaleReads?: string;
|
||||
|
||||
@@ -192,3 +192,12 @@ redis.xread('STREAMS', 'streamName', '0-0');
|
||||
redis.xreadgroup('GROUP', 'groupName', 'consumerName', 'STREAMS', 'streamName', '>');
|
||||
redis.xrevrange('streamName', '+', '-', 'COUNT', 1);
|
||||
redis.xtrim('streamName', 'MAXLEN', '~', 1000);
|
||||
|
||||
// ClusterRetryStrategy can return non-numbers to stop retrying
|
||||
new Redis.Cluster([], {
|
||||
clusterRetryStrategy: () => null
|
||||
});
|
||||
|
||||
new Redis.Cluster([], {
|
||||
clusterRetryStrategy: () => 1
|
||||
});
|
||||
|
||||
Vendored
+2
-1
@@ -7,6 +7,7 @@
|
||||
// Shahar Mor <https://github.com/shaharmor>
|
||||
// Whemoon Jang <https://github.com/palindrom615>
|
||||
// Francis Gulotta <https://github.com/reconbot>
|
||||
// Alex Petty <https://github.com/pettyalex>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -894,7 +895,7 @@ declare namespace IORedis {
|
||||
}
|
||||
|
||||
interface ClusterOptions {
|
||||
clusterRetryStrategy?(times: number): number;
|
||||
clusterRetryStrategy?(times: number): number | null;
|
||||
enableOfflineQueue?: boolean;
|
||||
enableReadyCheck?: boolean;
|
||||
scaleReads?: string;
|
||||
|
||||
@@ -153,3 +153,12 @@ new Redis.Cluster([{
|
||||
host: 'localhost',
|
||||
port: 6379
|
||||
}]);
|
||||
|
||||
// ClusterRetryStrategy can return non-numbers to stop retrying
|
||||
new Redis.Cluster([], {
|
||||
clusterRetryStrategy: () => null
|
||||
});
|
||||
|
||||
new Redis.Cluster([], {
|
||||
clusterRetryStrategy: () => 1
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user