diff options
author | Sarven Capadisli <csarven@status.net> | 2010-01-13 13:37:04 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-01-13 13:37:04 +0000 |
commit | 543026b8d1411c7d71a6482d0649ab3523f489b8 (patch) | |
tree | b4e4ac6a8f89411faf7a0cfd11fbe63a4a344a03 /classes/Queue_item.php | |
parent | 21512910c1d882b62f921154209e6f3c4792f03b (diff) | |
parent | c26246c4c3eb7fb4002e7280c0421ed2fa96b767 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes/Queue_item.php')
-rw-r--r-- | classes/Queue_item.php | 9 |
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); |