Problem/Motivation
Currently if the queue is empty, the processor will stop. It would be nice if we could control whether the processor should do that or not.
Add a stop when empty configuration that defaults to TRUE to ensure BC.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3275594-6.patch | 5.08 KB | jsacksick |
| #2 | 3275594-2.patch | 4.71 KB | johnwebdev |
Comments
Comment #2
johnwebdev commentedComment #3
jsacksick commentedThat was actually the behavior in the 7.x version, if I'm not mistaken, it was acting like a "daemon" that would keep running in the background.
Maybe we should make the option more explicit? "Daemonize", with a description that reads: "Keep the processor running in the background even if there are no jobs to process"
Thoughts?
Comment #4
jcnventuraSeems like #3133969: Restore `timeout` option for Drush command also uses a daemon approach but with a configurable timeout (set to 90 seconds by default).
Seems like that solution would be a better option.
Comment #5
mglamanThe one problem with #3133969: Restore `timeout` option for Drush command is that an empty queue will cause a daemonized runner to keep restarting the command over and over and over again instead of periodically if the queue is empty.
If the queue is empty, the command will quit. Then it will be run again. I'm not sure if this good or bad.
Comment #6
jsacksick commentedWill give this patch a try, patch had to be re-rolled.
Comment #7
jsacksick commentedI think this is good to go, this has been in use in 5 different production websites for 2 months.
Comment #8
jsacksick commentedCommitted, thanks @johnwebdev!
Comment #10
bojanz commentedI honestly don't see why the processor should every quit when the queue is empty. I know we originally implemented it that way, but I have no recollection why. Most other queue processors will sleep for a configurable amount of seconds, then try to claim a job again.