Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bugfix health provider #281

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.0.2](https://github.com/nest-modules/ioredis/compare/v2.0.1...v2.0.2) (2024-02-24)


### Bug Fixes

* bugfix health provider ([82ae2d3](https://github.com/nest-modules/ioredis/commit/82ae2d3b024836e51e579c58173ee5085410ab9f))

### [2.0.1](https://github.com/nest-modules/ioredis/compare/v2.0.0...v2.0.1) (2023-12-22)


Expand Down
4 changes: 4 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Redis Module
export * from './redis.module';
export * from './redis.decorators';
export * from './redis.interfaces';
export * from './redis.utils';

// Health Indicator
export * from './indicator/redis-health.provider';
export * from './indicator/redis-health.indicator';
export * from './indicator/redis-health.module';
11 changes: 8 additions & 3 deletions lib/indicator/redis-health.provider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Redis from 'ioredis';
import { REDIS_HEALTH_INDICATOR } from '../redis.constants';
import Redis, { RedisOptions } from 'ioredis';
import { REDIS_HEALTH_INDICATOR, REDIS_CONFIG_OPTIONS } from '../redis.constants';

export const redisHealthIndicatorProvider = {
provide: REDIS_HEALTH_INDICATOR,
useFactory: () => new Redis(),
useFactory: (
redisConfigOrConnection: RedisOptions | Redis
) => redisConfigOrConnection instanceof Redis
? redisConfigOrConnection
: new Redis(redisConfigOrConnection),
inject: [REDIS_CONFIG_OPTIONS],
};
1 change: 1 addition & 0 deletions lib/redis.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export const REDIS_MODULE_CONNECTION_TOKEN = 'IORedisModuleConnectionToken';
export const REDIS_MODULE_OPTIONS_TOKEN = 'IORedisModuleOptionsToken';

export const REDIS_HEALTH_INDICATOR = 'redisHealthIndicator';
export const REDIS_CONFIG_OPTIONS = 'RedisConfigOptions';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs-modules/ioredis",
"version": "2.0.1",
"version": "2.0.2",
"description": "Nest - a ioredis module (@ioredis)",
"author": "Nest Modules TM",
"private": false,
Expand Down