summaryrefslogtreecommitdiff
path: root/classes/Queue_item.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Queue_item.php')
-rw-r--r--classes/Queue_item.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/classes/Queue_item.php b/classes/Queue_item.php
index 9c673540d..cf805a606 100644
--- a/classes/Queue_item.php
+++ b/classes/Queue_item.php
@@ -25,10 +25,12 @@ class Queue_item extends Memcached_DataObject
function sequenceKey()
{ return array(false, false); }
- static function top($transport) {
+ static function top($transport=null) {
$qi = new Queue_item();
- $qi->transport = $transport;
+ if ($transport) {
+ $qi->transport = $transport;
+ }
$qi->orderBy('created');
$qi->whereAdd('claimed is null');
@@ -40,7 +42,8 @@ class Queue_item extends Memcached_DataObject
# XXX: potential race condition
# can we force it to only update if claimed is still null
# (or old)?
- common_log(LOG_INFO, 'claiming queue item = ' . $qi->notice_id . ' for transport ' . $transport);
+ common_log(LOG_INFO, 'claiming queue item = ' . $qi->notice_id .
+ ' for transport ' . $qi->transport);
$orig = clone($qi);
$qi->claimed = common_sql_now();
$result = $qi->update($orig);