Wrap notice-saving code in a transaction
This commit is contained in:
parent
af2fb7dff2
commit
4873277b58
|
@ -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);
|
||||
|
@ -159,6 +161,8 @@ class Notice extends Memcached_DataObject
|
|||
|
||||
$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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user