Commit 5c3fdc3e authored by webchick's avatar webchick

#985184 by Steven Jones: Fix brain-o in Batch query causing bad performance on large tables.

parent 5baaa76b
......@@ -21,7 +21,7 @@
class BatchQueue extends SystemQueue {
public function claimItem($lease_time = 0) {
$item = db_query('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', array(':name' => $this->name))->fetchObject();
$item = db_query_range('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, array(':name' => $this->name))->fetchObject();
if ($item) {
$item->data = unserialize($item->data);
return $item;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment