From: Tim Starling Date: Sun, 21 Aug 2005 06:09:56 +0000 (+0000) Subject: put watchlist update in its own transaction, to reduce lock contention and thus incre... X-Git-Tag: 1.6.0~1849 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=f9279f4b53f9410cf3e737951f179fcf232f0233;p=lhc%2Fweb%2Fwiklou.git put watchlist update in its own transaction, to reduce lock contention and thus increase speed --- diff --git a/includes/Article.php b/includes/Article.php index a99e733502..d58b48ac33 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1273,10 +1273,18 @@ class Article { if ( $good ) { if ($watchthis) { - if (!$this->mTitle->userIsWatching()) $this->watch(); + if (!$this->mTitle->userIsWatching()) { + $dbw->immediateCommit(); + $dbw->begin(); + $this->watch(); + $dbw->commit(); + } } else { if ( $this->mTitle->userIsWatching() ) { + $dbw->immediateCommit(); + $dbw->begin(); $this->unwatch(); + $dbw->commit(); } } # standard deferred updates