Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
legacy-auth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
middlewares
legacy-auth
Commits
26786b94
Commit
26786b94
authored
2 years ago
by
Sébastien DA ROCHA
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into 'development'
reactive sentinel en develop See merge request
!22
parents
fd70063f
0934d9ec
No related branches found
Branches containing commit
No related tags found
1 merge request
!22
reactive sentinel en develop
Pipeline
#37034
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/health/redis.healthIndicator.ts
+7
-2
7 additions, 2 deletions
src/health/redis.healthIndicator.ts
src/helpers/redis.helper.ts
+10
-1
10 additions, 1 deletion
src/helpers/redis.helper.ts
with
17 additions
and
3 deletions
src/health/redis.healthIndicator.ts
+
7
−
2
View file @
26786b94
...
...
@@ -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
This diff is collapsed.
Click to expand it.
src/helpers/redis.helper.ts
+
10
−
1
View file @
26786b94
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment