-
Notifications
You must be signed in to change notification settings - Fork 638
option to wait for callbacks completion on job.stop() #713
Copy link
Copy link
Closed
Labels
good first issueGood for newcomersGood for newcomershacktoberfestThis issue is registered for Hacktoberfest!This issue is registered for Hacktoberfest!help wantedExtra attention is neededExtra attention is neededreleasedstatus:readyReady to start implementationReady to start implementationtype:featureNew feature or feature improvement & requestsNew feature or feature improvement & requests
Description
⭐ 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershacktoberfestThis issue is registered for Hacktoberfest!This issue is registered for Hacktoberfest!help wantedExtra attention is neededExtra attention is neededreleasedstatus:readyReady to start implementationReady to start implementationtype:featureNew feature or feature improvement & requestsNew feature or feature improvement & requests