From 0adf14d2f66c897408da81c01b1191b8d9ad274d Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Tue, 23 Apr 2024 10:34:04 +0200 Subject: [PATCH] fix(ioredis): fix reconnectOnError assignation on Redis connection options Closes: #2668 --- packages/orm/ioredis/src/utils/registerConnectionProvider.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/orm/ioredis/src/utils/registerConnectionProvider.ts b/packages/orm/ioredis/src/utils/registerConnectionProvider.ts index 9d154f01c54..1fe60006235 100644 --- a/packages/orm/ioredis/src/utils/registerConnectionProvider.ts +++ b/packages/orm/ioredis/src/utils/registerConnectionProvider.ts @@ -54,6 +54,7 @@ export function registerConnectionProvider({provide, name = "default"}: CreateCo setValue(sentinelsOptions, "sentinelRetryStrategy", retryStrategy); setValue(sentinelsOptions, "redisOptions.reconnectOnError", reconnectOnError); + connection = new Redis({ name: sentinelName, sentinels, @@ -62,9 +63,9 @@ export function registerConnectionProvider({provide, name = "default"}: CreateCo }); } else { connection = new Redis({ + reconnectOnError, ...redisOptions, - lazyConnect: true, - reconnectOnError + lazyConnect: true } as RedisOptions); }