You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This way, you make use of the Node.js caching mechanism and avoid the global variable definition (which is a bad practice).
PS: I haven't tested this code. Let me know if there's anything wrong with it.
PS2: It'd be really nice from @kamilmysliwiec to give us his opinion about this 🙂
I have a process that runs repetitively on a cron Job using Bull
This process is outside from my Nest application context, but I need to call methods of a component of my nest application.
I am using NestFactory.createApplicationContext () to obtain the instance of my component, on follow mode:
But this causes that during each execution of the process (every minute) NestFactory and InstanceLoader are initialized
Another alternative that works for me is adding the app to global interface in the following way:
I would like to know what implications have in terms of performance and what is the best practice to do so?
The reproducible example is in this repository
The text was updated successfully, but these errors were encountered: