[Q] How to process only one job and then shutdown?
See original GitHub issueIf I run node worker.js
then the process stays alive and waits for any jobs to process.
And ofcourse it processes any jobs it can find … BUT
Is there a way to shutdown once a job is processed?
I know it sounds strange but for me this is important.
Can I hook into the done
method somehow and pass it an anonymous function to execute a queue.shutdown
?
Any ideas or solutions are welcome.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
A stop job is running for Session c2 of user
I'm not sure if you can still switch to a getty during shutdown, but try hitting Ctrl+Alt+F2 when "A stop job is running...
Read more >A Guide to Employee Rights When a Company Closes Down
If you've lost your job due to a company shutdown, you have the right to receive your final paycheck within the timelines set...
Read more >If server is shutdown, unfinished jobs won't resume · Issue #410
If you interrupt a running job, restart your application, and then manually change the interrupted job's lockedAt time to 10+ minutes earlier ( ......
Read more >Go - graceful shutdown of worker goroutines | Callista
In this blog post we'll take a look at gracefully shutting down a Go program having worker goroutines performing tasks that must be ......
Read more >Batch jobs after shutdown - SAP Community
The Jobs will run at the same time it was scheduled once the system is UP. This is just like how a Mobile...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the docker logs were confusing me.
This test shows a worker that handles multiple jobs where bad code leaks data across jobs.
This test proves that a worker which can properly shutdown after one job is finished, will not leak data across jobs.
Here is the smaller version of
docker-compose.yml
which I used to run tests:not needed if you think so 😃