This patch depends on http://drupal.org/node/208286.

This patch adds a locked column to to the job_queue table and add a locked argument to job_queue_dequeue. When a job is dequeued the locked column will be set to the locked argument. You can use this to identify the called of job_queue_dequeue in the case you have multiple servers or processes handling the job queue.

CommentFileSizeAuthor
#2 jobqueue.test2.71 KBdopry
#1 job_queue-locking.patch2.15 KBdopry

Comments

dopry’s picture

StatusFileSize
new2.15 KB
dopry’s picture

StatusFileSize
new2.71 KB

here is an updated .test file to cover attempting to dequeue a locked job... It's hard to really test the feature, since you can't easily emulate concurrency within a test.

drumm’s picture

Status: Needs review » Needs work

The code has changed a bit in Drupal 6.

I would like to use this opportunity to add more information to the queue UI. The job status could be added to admin/reports/job_queue which says that the job is running, and for how long.