From fd70063f001cc0eb340c6c42d9d1c8fd074eb871 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= <sdarocha@neogeo.fr>
Date: Thu, 23 Jun 2022 20:35:44 +0000
Subject: [PATCH] =?UTF-8?q?D=C3=A9sactive=20l'utilisation=20de=20sentinel?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/health/redis.healthIndicator.ts |  9 ++-------
 src/helpers/redis.helper.ts         | 11 +----------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/src/health/redis.healthIndicator.ts b/src/health/redis.healthIndicator.ts
index bdf6308..6c6f2b0 100644
--- a/src/health/redis.healthIndicator.ts
+++ b/src/health/redis.healthIndicator.ts
@@ -7,12 +7,7 @@ export class RedisHealthIndicator extends HealthIndicator {
 
   async checkRedisConnection(redisConf: { sentinelHost: string, sentinelPort: number, groupName: string; }): Promise<HealthIndicatorResult> {
 
-    const client = new IORedis({
-      sentinels: [
-        { host: redisConf.sentinelHost, port: redisConf.sentinelPort },
-      ],
-      name: redisConf.groupName,
-    });
+    const client = new IORedis({ host: redisConf.sentinelHost, port: redisConf.sentinelPort});
 
     await new Promise((resolve, reject) => {
       client.on('ready', resolve);
@@ -33,4 +28,4 @@ export class RedisHealthIndicator extends HealthIndicator {
 
     return this.getStatus('Redis', true);
   }
-}
\ No newline at end of file
+}
diff --git a/src/helpers/redis.helper.ts b/src/helpers/redis.helper.ts
index e73e6ef..67518e8 100644
--- a/src/helpers/redis.helper.ts
+++ b/src/helpers/redis.helper.ts
@@ -13,16 +13,7 @@ export class Redis {
     Logger.log(`Entering function`, `Redis.connect`);
     let cfg:any={
         host: this.redisConfig.sentinelHost, port: this.redisConfig.sentinelPort ,
-        name: this.redisConfig.groupName,
     };
-    if(this.redisConfig.sentinel){
-      cfg={
-          sentinels: [
-            { host: this.redisConfig.sentinelHost, port: this.redisConfig.sentinelPort },
-          ],
-          name: this.redisConfig.groupName,
-      };
-    }
 
     const client = new IORedis(cfg);
 
@@ -103,4 +94,4 @@ export class Redis {
       handleError(error, new InternalServerErrorException('Couldn\'t remove key/value in redis.'));
     }
   }
-}
\ No newline at end of file
+}
-- 
GitLab