Open YannHulot opened 11 months ago
related to #556 since both features need to watch for callbacks completion
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?
⭐ Suggestion
Do not stop the jobs if the
onTick
function is being executed. Wait for this function to resolve first and then, resolvejob.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 myonTick
function is currently running, then, I would like to wait for theonTick
function to resolve before thejob.stop(
) function resolves itself so I don't close the DB connection before those jobs are done since they need it.Related