From f9279f4b53f9410cf3e737951f179fcf232f0233 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 21 Aug 2005 06:09:56 +0000 Subject: [PATCH] put watchlist update in its own transaction, to reduce lock contention and thus increase speed --- includes/Article.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.20.1