From e84439d5c595c0b3c3e9996a47f8a2eac49a14e9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 13 Sep 2008 12:43:33 -0400 Subject: [PATCH] duplicate confirmation to avoid where clause darcs-hash:20080913164333-84dde-ef4f3363e045aabd52173ea9be34b2f59f64d084.gz --- scripts/xmppconfirmhandler.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index d1735d8d2e..8961b0b6e3 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -66,15 +66,22 @@ class XmppConfirmHandler extends XmppQueueHandler { continue; } else { $this->log(LOG_INFO, 'Confirmation sent for ' . $confirm->address); - # Mark confirmation sent - $original = clone($confirm); - $confirm->sent = $confirm->claimed; - $result = $confirm->update($original); + # Mark confirmation sent; need a dupe so we don't have the WHERE clause + $dupe = Confirm_address::staticGet('code', $confirm->code); + if (!$dupe) { + common_log(LOG_WARNING, 'Could not refetch confirm', __FILE__); + continue; + } + $orig = clone($dupe); + $dupe->sent = $dupe->claimed; + $result = $dupe->update($orig); if (!$result) { - common_log_db_error($confirm, 'UPDATE', __FILE__); + common_log_db_error($dupe, 'UPDATE', __FILE__); # Just let the claim age out; hopefully things work then continue; } + $dupe->free(); + unset($dupe); } $user->free(); unset($user); -- 2.39.5