]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Queue_item.php
Fix for bug #2382: releasing claim on failed queue item works again with DB-based...
[quix0rs-gnu-social.git] / classes / Queue_item.php
index f83c2cef184d49f868d712a82a016fefa34d4c68..c7e17be6e84556d56e9e55360e7aed483a274b1d 100644 (file)
@@ -64,4 +64,17 @@ class Queue_item extends Memcached_DataObject
         $qi = null;
         return null;
     }
+
+    /**
+     * Release a claimed item.
+     */
+    function releaseCLaim()
+    {
+        // DB_DataObject doesn't let us save nulls right now
+        $sql = sprintf("UPDATE queue_item SET claimed=NULL WHERE id=%d", $this->id);
+        $this->query($sql);
+
+        $this->claimed = null;
+        $this->encache();
+    }
 }