summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-16 17:44:16 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-16 17:44:16 +0000
commit775b4561fec7aef0eae71172559f4c000a25d458 (patch)
treecb033b81843f916a514a1af9037d11f00da31b1a /modules/system
parent2d6b6d492f9757ee19d992f90d73b99235f58609 (diff)
downloadbrdo-775b4561fec7aef0eae71172559f4c000a25d458.tar.gz
brdo-775b4561fec7aef0eae71172559f4c000a25d458.tar.bz2
- Patch #659710 by fgm: queue API was missing a releaseItem method.
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.queue.inc18
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)