Skip to content
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

Exceptions not handled in cronjob functions added via SchedulerRegistry #1079

Closed
2 of 4 tasks
simon1389 opened this issue Oct 31, 2022 · 3 comments
Closed
2 of 4 tasks
Labels
bug Something isn't working needs triage

Comments

@simon1389
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When adding a cronjob by using the SchedulerRegistry, exceptions occuring inside the cron-function are not handled and cause the app to exit.
In a previous commit this behavior was fixed when using the @Cron annotation (0cdfe8f)

Minimum reproduction code

https://github.com/simon1389/nestjs-schedule-bug

Steps to reproduce

  1. npm start
  2. See the error on console and the application shutdown

Expected behavior

I expect the same behavior as when using the @Cron syntax.
So the error should be catched.

Package version

2.1.0

NestJS version

9.0.0

Node.js version

16.17.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@simon1389 simon1389 added bug Something isn't working needs triage labels Oct 31, 2022
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@simon1389
Copy link
Author

PR opened 😃

@kamilmysliwiec
Copy link
Member

Let's track this here #1084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants