From 775b4561fec7aef0eae71172559f4c000a25d458 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 16 Dec 2009 17:44:16 +0000
Subject: [PATCH] - Patch #659710 by fgm: queue API was missing a releaseItem
 method.

---
 modules/system/system.queue.inc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/modules/system/system.queue.inc b/modules/system/system.queue.inc
index be0c31e97ec8..5174a0a6521a 100644
--- a/modules/system/system.queue.inc
+++ b/modules/system/system.queue.inc
@@ -135,6 +135,15 @@ public function claimItem($lease_time = 3600);
    */
   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.
    *
@@ -216,6 +225,15 @@ public function claimItem($lease_time = 30) {
     }
   }
 
+  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)
-- 
GitLab