Skip to content

Commit

Permalink
feat: make module global
Browse files Browse the repository at this point in the history
  • Loading branch information
bassochette committed Mar 7, 2022
1 parent fc873cb commit 4a5b989
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
12 changes: 0 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/redis/redis.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DynamicModule, Module, Provider } from "@nestjs/common";
import { DynamicModule, Global, Module, Provider } from "@nestjs/common";
import { RedisProvider } from "./redis.provider";
import {
REDIS_OPTIONS,
Expand All @@ -7,6 +7,7 @@ import {
} from "./redis.config";
import { REDIS_CLIENT } from "./redis.client";

@Global()
@Module({})
export class RedisModule {
public static forRoot(options: RedisConnectionOptions): DynamicModule {
Expand Down
1 change: 1 addition & 0 deletions src/redis/redis.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class RedisProvider {
Logger.error(error.message, error.stack, REDIS_CLIENT);
});
this.client.on("connect", () => {
Logger.verbose(this.options, RedisProvider.name);
Logger.log("client connected", REDIS_CLIENT);
});

Expand Down

0 comments on commit 4a5b989

Please sign in to comment.