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

option to wait for callbacks completion on job.stop() #713

Open
Tracked by #674
YannHulot opened this issue Oct 12, 2023 · 2 comments Β· May be fixed by #894
Open
Tracked by #674

option to wait for callbacks completion on job.stop() #713

YannHulot opened this issue Oct 12, 2023 · 2 comments Β· May be fixed by #894
Labels
good first issue Good for newcomers hacktoberfest This issue is registered for Hacktoberfest! help wanted Extra attention is needed status:ready Ready to start implementation type:feature New feature or feature improvement & requests

Comments

@YannHulot
Copy link

YannHulot commented Oct 12, 2023

⭐ Suggestion

Do not stop the jobs if the onTick function is being executed. Wait for this function to resolve first and then, resolve job.stop()

πŸ’» Use Cases

Basically I am trying to gracefully shut down my cron jobs when deploying a new version of my back-end.

That means that ideally, I want to call job.stop() on all the ongoing jobs, Then once they are done, I want to close the DB connection and so on and so forth.

The problem is that those jobs are mostly doing async stuff, so if I call a job.stop() and my onTick function is currently running, then, I would like to wait for the onTick function to resolve before the job.stop() function resolves itself so I don't close the DB connection before those jobs are done since they need it.

Related

@YannHulot YannHulot added the type:feature New feature or feature improvement & requests label Oct 12, 2023
@sheerlox sheerlox changed the title Let onTick function resolve before shutting down jobs when calling job.stop() option to wait for callbacks completion on job.stop() Oct 12, 2023
@sheerlox
Copy link
Collaborator

related to #556 since both features need to watch for callbacks completion

@sheerlox sheerlox added hacktoberfest This issue is registered for Hacktoberfest! status:ready Ready to start implementation help wanted Extra attention is needed good first issue Good for newcomers labels Oct 12, 2023
@Zamoca42 Zamoca42 linked a pull request Sep 4, 2024 that will close this issue
9 tasks
@rohith1222004
Copy link

I noticed that PR #894 is linked to this issue for supporting async handling and job status tracking. Is this feature close to completion, or would you still like help working on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest This issue is registered for Hacktoberfest! help wanted Extra attention is needed status:ready Ready to start implementation type:feature New feature or feature improvement & requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants