Skip to content
Snippets Groups Projects
Commit 0934d9ec authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA
Browse files

Merge branch 'revert-f73fb5f7' into 'master'

Revert "Merge branch 'development' into 'master'"

See merge request !21
parents f73fb5f7 bec5c825
No related branches found
No related tags found
2 merge requests!22reactive sentinel en develop,!21Revert "Merge branch 'development' into 'master'"
Pipeline #37033 passed
......@@ -7,7 +7,12 @@ export class RedisHealthIndicator extends HealthIndicator {
async checkRedisConnection(redisConf: { sentinelHost: string, sentinelPort: number, groupName: string; }): Promise<HealthIndicatorResult> {
const client = new IORedis({ host: redisConf.sentinelHost, port: redisConf.sentinelPort});
const client = new IORedis({
sentinels: [
{ host: redisConf.sentinelHost, port: redisConf.sentinelPort },
],
name: redisConf.groupName,
});
await new Promise((resolve, reject) => {
client.on('ready', resolve);
......@@ -28,4 +33,4 @@ export class RedisHealthIndicator extends HealthIndicator {
return this.getStatus('Redis', true);
}
}
}
\ No newline at end of file
......@@ -13,7 +13,16 @@ 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);
......@@ -94,4 +103,4 @@ export class Redis {
handleError(error, new InternalServerErrorException('Couldn\'t remove key/value in redis.'));
}
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment