-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
CLI hangs forever with some modules #1042
Comments
As mentioned in the discussion, it looks like things do end up closing and exiting, it just takes time, for whatever reason. Are you seeing that it is truly hanging indefinitely now? |
@jmcdo29 Just clone the reproduction repo but I agree, it seems to end up closing. However, ideally it should exit instantly. Do you have any workaround / solution to have it exit once done? |
In our production repo I can confirm it hangs forever, it could be related to other modules, but I assume the underlying issue is the same, and if it could be fixed in the redis example, I think it would fix other similar issues as well |
So, I took your example, and modified it a bit to see if this is directly related to nest-commander, or something else. Changing the import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { AppService } from './app.service';
async function bootstrap() {
// const app = await NestFactory.create(AppModule);
// await app.listen(3000);
const app = await NestFactory.createApplicationContext(AppModule);
console.log(app.get(AppService, { strict: false }).getHello());
await app.close();
}
bootstrap(); And running it twice results in the same behavior. It would seem like a queue is being created and not closed immediately. I haven't found the why of that, but I don't believe this is related to nest-commander |
Hi, I'll join this discussion with similar findings to Jay's. In my case, a regular import { repl } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const replServer = await repl(AppModule);
replServer.setupHistory('.nestjs_repl_history', (err) => {
if (err) {
console.error(err);
}
});
}
bootstrap().catch(console.error); I've traced it down to bull/redis - the repl stops correctly when I comment out all But maybe it's a different issue, on |
@wodCZ maybe? probably due to the
|
I'm going to close this as it doesn't seem to be directly related to nest-commander |
Is there an existing issue for this?
Current behavior
If I add:
To my CliModule it will always run, so if we have cron jobs that uses a cli command it will keep reporting as 'Running'.
If I remove the BullModule the command will exit as usual.
Minimum reproduction code
https://github.com/simplenotezy/bullmq-and-commander
Run
docker-compose up
to get a redis instance spinning and then you can runnode dist/cli basic
and you'll notice it hangs.Note: it only happens when after adding the
TestProcessor
toAppModule
. If you remove the processor, it will work fine.Expected behavior
Should not hang
Package
nest-commander
nest-commander-schematics
nest-commander-testing
Package version
N/A
Node.js version
No response
In which operating systems have you tested?
Other
Related to: #945
The text was updated successfully, but these errors were encountered: