Make global module as an option
See original GitHub issueHi! 👋
Firstly, thanks for your work on this project! 🙂
I would like to set up the redis module in a non-global way, so is there a chance we can make it configurable? Thanks!
Here is the diff that solved my problem:
diff --git a/node_modules/@liaoliaots/nestjs-redis/dist/redis/redis.module.js b/node_modules/@liaoliaots/nestjs-redis/dist/redis/redis.module.js
index 8d6de0a..d72312e 100644
--- a/node_modules/@liaoliaots/nestjs-redis/dist/redis/redis.module.js
+++ b/node_modules/@liaoliaots/nestjs-redis/dist/redis/redis.module.js
@@ -29,7 +29,7 @@ let RedisModule = RedisModule_1 = class RedisModule {
...redisClientProviders
];
return {
- global: true,
+ global: false,
module: RedisModule_1,
providers,
exports: [redis_manager_1.RedisManager, ...redisClientProviders]
This issue body was partially generated by patch-package.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Make changes to a global module in only one template
To make a change to your global module that will only affect one page, go to your template and make a local copy...
Read more >How to programmatically set a global (module) variable?
Here is a better way to do it: import sys definitions = {'a': 1, 'b': 2, 'c': 123.4} module = sys.modules[__name__] for name, ......
Read more >Documentation - Global: Modifying Module - TypeScript
A global-modifying module alters existing values in the global scope when they are imported. For example, there might exist a library which adds...
Read more >Adding Global Modules <add> - Microsoft Learn
Optional string attribute. Specifies conditions under which the global module will run. The preCondition attribute can have one or more of the ...
Read more >What is a Divi Global Module and How to Create One?
Give your global module a name and tick the Make this a global item option and click the Save to Library button. Global...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
please follow the steps below:
@liaoliaots/nestjs-redis
to6.0.0
SharedRedis
to your business module:@AvantaR It may be useful for you to import files in the correct order:
As mentioned above, decorator
@InjectRedis
is used inCatsService
. If importSharedRedis
beforeCatsService
, nest will throw an error, as shown below. Because some methods inRedisModule
will get called after the@InjectRedis
calls and thereforeRedisModule
will create/re-export providers correctly.If import
CatsService
first, it works as expected:- - OR - - You can use
RedisModule
in the global scope, that error will not exist.