From c33f6a03a7b71a66c27a794794894472e667e87a Mon Sep 17 00:00:00 2001 From: Alko89 Date: Wed, 27 Aug 2025 15:36:41 +0200 Subject: [PATCH 1/2] fix: allow passing redis options --- .../src/throttler-storage-redis.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts b/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts index 8750d56..d675edd 100644 --- a/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts +++ b/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts @@ -12,12 +12,12 @@ export class ThrottlerStorageRedisService implements ThrottlerStorageRedis, OnMo constructor(redis?: Redis); constructor(cluster?: Cluster); constructor(options?: RedisOptions); - constructor(url?: string); - constructor(redisOrOptions?: Redis | Cluster | RedisOptions | string) { + constructor(url?: string, options?: RedisOptions); + constructor(redisOrOptions?: Redis | Cluster | RedisOptions | string, options?: RedisOptions) { if (redisOrOptions instanceof Redis || redisOrOptions instanceof Cluster) { this.redis = redisOrOptions; } else if (typeof redisOrOptions === 'string') { - this.redis = new Redis(redisOrOptions as string); + this.redis = new Redis(redisOrOptions as string, options); this.disconnectRequired = true; } else { this.redis = new Redis(redisOrOptions as RedisOptions); From 2e9c2eb556c2401a8b3169b3860c7f1f2cce3b2f Mon Sep 17 00:00:00 2001 From: Alko89 Date: Wed, 27 Aug 2025 15:41:50 +0200 Subject: [PATCH 2/2] fix: options --- .../src/throttler-storage-redis.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts b/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts index d675edd..ae62809 100644 --- a/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts +++ b/packages/throttler-storage-redis/src/throttler-storage-redis.service.ts @@ -17,7 +17,7 @@ export class ThrottlerStorageRedisService implements ThrottlerStorageRedis, OnMo if (redisOrOptions instanceof Redis || redisOrOptions instanceof Cluster) { this.redis = redisOrOptions; } else if (typeof redisOrOptions === 'string') { - this.redis = new Redis(redisOrOptions as string, options); + this.redis = new Redis(redisOrOptions as string, options ?? {}); this.disconnectRequired = true; } else { this.redis = new Redis(redisOrOptions as RedisOptions);