Warning: DB-based queue doesn't currently implement discarding of items after a retry limit. Failed items will be retried until they succeed.
$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();
+ }
}
if (empty($qi->claimed)) {
$this->_log(LOG_WARNING, "[$queue:item $qi->id] Ignoring failure for unclaimed queue item");
} else {
- $orig = clone($qi);
- $qi->claimed = null;
- $qi->update($orig);
+ $qi->releaseClaim();
}
$this->stats('error', $queue);