Replies: 2 comments
-
A graceful shutdown is carried out by iterating over scheduledJobs, running
Note that jobs are only stored automatically in the scheduledJobs array if they are named. |
Beta Was this translation helpful? Give feedback.
-
Ah! I see - and the program doesn't terminate until the job is done running - that works! Would still be nice, I think, to have a stopAndWait() method that returns a promise which resolves when the current execution (if any) is done |
Beta Was this translation helpful? Give feedback.
-
Maybe this is possible and I just can't find it in the docs. I'd like to handle SIGTERM gracefully like this:
It would be cool if there was something like this:
await scheduledJobs.drain()
or something like thatWhat's the recommended way to do this?
Beta Was this translation helpful? Give feedback.
All reactions