File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/health-indicator/src/lib Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,22 @@ import {
33 HealthIndicatorResult ,
44 HealthIndicatorService ,
55} from '@nestjs/terminus' ;
6- import type { createClient , createCluster , createSentinel } from 'redis' ;
6+ import type {
7+ RedisClientType ,
8+ RedisClusterType ,
9+ RedisSentinelType ,
10+ createClient ,
11+ createCluster ,
12+ createSentinel ,
13+ } from 'redis' ;
714
815type Redis =
916 | ReturnType < typeof createClient >
1017 | ReturnType < typeof createCluster >
11- | ReturnType < typeof createSentinel > ;
18+ | ReturnType < typeof createSentinel >
19+ | RedisClientType
20+ | RedisClusterType
21+ | RedisSentinelType ;
1222
1323@Injectable ( )
1424export class RedisHealthIndicator {
@@ -31,6 +41,7 @@ export class RedisHealthIndicator {
3141 const indicator = this . healthIndicatorService . check ( key ) ;
3242
3343 try {
44+ // @ts -expect-error: for some reason RedisClusterType doesn't have ping method in types but it exists in runtime
3445 const result = await client . ping ( ) ;
3546 const isHealthy = result === 'PONG' ;
3647
You can’t perform that action at this time.
0 commit comments