-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
NestFactory.createApplicationContext run successfully but never exit. How to shutdown app gracefully? #503
Comments
maybe mongoose open database connection and not closed properly. |
Looking into this now. Thanks for reporting! |
Fixed in the incoming |
I have the same problem with cron job. |
Now I have the opposite problem. My main.ts contains import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
await NestFactory.createApplicationContext(AppModule);
}
bootstrap(); Inside my app module i create moleculer instance that connects to Redis and waiting for incoming events, but 10 seconds later i have
It is not expected behaviour. |
I use export async function getApp () {
return NestFactory.createApplicationContext(AppModule)
} const app = await getApp()
// do someting
app.close() |
I'm using NestJS version |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I love this idea so much,
Thanks to that, you can take advantages of the Nest framework everywhere, including CRON jobs and even build a CLI on top of it.
, but stuck.create app context and invoke marketService.test()
marketService.test() log message successfully, but script never exit. how can I use i in CRON?
The text was updated successfully, but these errors were encountered: