diff options
author | Brion Vibber <brion@pobox.com> | 2010-06-26 15:10:47 -0400 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-06-26 15:10:47 -0400 |
commit | fa282823d9834d411bf2434be1406d4c2ca09b2c (patch) | |
tree | 29bdb9d8f1a0723607eae3870934bd734757760e | |
parent | 00e129b01343e37dbd662b95f423e731b0867023 (diff) | |
parent | c6b1e25d1732471f91687cc09ace5face1820b72 (diff) |
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
-rw-r--r-- | classes/Queue_item.php | 13 | ||||
-rw-r--r-- | lib/dbqueuemanager.php | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/classes/Queue_item.php b/classes/Queue_item.php index f83c2cef1..c7e17be6e 100644 --- a/classes/Queue_item.php +++ b/classes/Queue_item.php @@ -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(); + } } diff --git a/lib/dbqueuemanager.php b/lib/dbqueuemanager.php index 3032e4ec7..3dda9fd1a 100644 --- a/lib/dbqueuemanager.php +++ b/lib/dbqueuemanager.php @@ -135,9 +135,7 @@ class DBQueueManager extends QueueManager 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); |