Conversation
There was a problem hiding this comment.
This is a nice simple approach to solving this problem but I think we should warn that if the queue exceeds a certain size then the cron job could run for a really long time and depending on the frequency of the cron job then multiple DBQ workers could be spawned at once.
Something along the lines of: "Note that if the queue is large it will be necessary to manage the lifetime of the process with a tool like timeout (http://man.he.net/?topic=timeout§ion=all) to make sure it doesn't run forever or that multiple worker processes aren't spawned depending on the frequency of your cron schedule."
|
Thanks @j4mie. I agree that it is simple and that there is attraction in that. |
python manage.py worker --drainwill start a worker process which will drain all jobs in the queue (if there are any) and then exit. This addresses #16 (from seven years ago 😱) and #52, and is an alternative (and much simpler) solution to that proposed in #56.