Hi everyone,
I have created a module that exports a provider registered with the DEFAULT scope. In my app module I import this module, and also inject it into the ThrottleModule using the forRootAsync method. When I start up my app i see that the provider itself is created only once ( the constructor is hit only once ), yet the onModuleInit method and the onModuleDestroy method of the provider are invoked twice!
This is very confusing - I would assume that I could use the lifecycle methods to perform resource management, yet this doesn't seem to be the case. Please could someone shed some light on the issue? I have a minimal repo here: https://github.com/magoogli/nest-js
Any help would be most appreciated.