From 3285e0979dc7e475291f1a8a0931868591fe0de7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 19 Jan 2009 22:21:16 -0500 Subject: Move add to notice inboxes before cache clearing in hopes they will be updated --- classes/Notice.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index ca8283bce..d614ceeba 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -155,6 +155,10 @@ class Notice extends Memcached_DataObject common_save_replies($notice); $notice->saveTags(); + // Add to notice inboxes + + $notice->addToInboxes(); + # Clear the cache for subscribed users, so they'll update at next request # XXX: someone clever could prepend instead of clearing the cache @@ -162,7 +166,6 @@ class Notice extends Memcached_DataObject $notice->blowCaches(); } - $notice->addToInboxes(); return $notice; } -- cgit v1.2.3-54-g00ecf From 4873277b58941ae6ec16543f437f4267ccab5ac0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 20 Jan 2009 08:19:32 -0500 Subject: Wrap notice-saving code in a transaction --- classes/Notice.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index d614ceeba..281696632 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 -- cgit v1.2.3-54-g00ecf