diff options
-rw-r--r-- | modules/system/system.queue.inc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/system/system.queue.inc b/modules/system/system.queue.inc index be0c31e97..5174a0a65 100644 --- a/modules/system/system.queue.inc +++ b/modules/system/system.queue.inc @@ -136,6 +136,15 @@ interface DrupalQueueInterface { public function deleteItem($item); /** + * Release an item that the worker could not process, so another + * worker can come in and process it before the timeout expires. + * + * @param $item + * @return boolean + */ + public function releaseItem($item); + + /** * Create a queue. * * Called during installation and should be used to perform any necessary @@ -216,6 +225,15 @@ class SystemQueue implements DrupalQueueInterface { } } + public function releaseItem($item) { + $update = db_update('queue') + ->fields(array( + 'expire' => 0, + )) + ->condition('item_id', $item->item_id); + return $update->execute(); + } + public function deleteItem($item) { db_delete('queue') ->condition('item_id', $item->item_id) |