From: Evan Prodromou Date: Tue, 20 Jan 2009 13:19:32 +0000 (-0500) Subject: Wrap notice-saving code in a transaction X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4873277b58941ae6ec16543f437f4267ccab5ac0;p=quix0rs-gnu-social.git Wrap notice-saving code in a transaction --- diff --git a/classes/Notice.php b/classes/Notice.php index d614ceebab..2816966321 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -125,6 +125,8 @@ class Notice extends Memcached_DataObject $notice->is_local = $is_local; } + $notice->query('BEGIN'); + $notice->reply_to = $reply_to; $notice->created = common_sql_now(); $notice->content = common_shorten_links($content); @@ -158,6 +160,8 @@ class Notice extends Memcached_DataObject // Add to notice inboxes $notice->addToInboxes(); + + $notice->query('COMMIT'); # Clear the cache for subscribed users, so they'll update at next request # XXX: someone clever could prepend instead of clearing the cache