Skip to content

Commit abf57a0

Browse files
committed
fix(health-indicator): add missing redis types
1 parent 31c4d2a commit abf57a0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

packages/health-indicator/src/lib/health.indicator.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff 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

815
type 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()
1424
export 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

0 commit comments

Comments
 (0)