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

Prevent new jobs running if job still in progress #1296

Closed
1 task done
andyslack opened this issue May 23, 2023 · 1 comment
Closed
1 task done

Prevent new jobs running if job still in progress #1296

andyslack opened this issue May 23, 2023 · 1 comment

Comments

@andyslack
Copy link

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

The problem here is long running crons which take longer than the recurring time, for example, if I have a cron which runs every 60 seconds, but during high loads it takes 100 seconds to complete, multiple jobs will run, leading to higher load on our services/database etc.

Describe the solution you'd like

I would love a flag/options in the options object to pass something like waitUntilFinished boolean which if passed and true it will not run the same job while an existing one is still running.

Teachability, documentation, adoption, migration strategy

As above.

What is the motivation / use case for changing the behavior?

Reducing load on application with multiple same jobs running.

@kamilmysliwiec
Copy link
Member

Please, report this issue here https://github.com/kelektiv/node-cron.

If you need more sophisticated features, I'd rather suggest using @nestjs/bull in combination with repeatable jobs instead of this package.

@nestjs nestjs locked and limited conversation to collaborators May 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants