put watchlist update in its own transaction, to reduce lock contention and thus incre...
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 21 Aug 2005 06:09:56 +0000 (06:09 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 21 Aug 2005 06:09:56 +0000 (06:09 +0000)
includes/Article.php

index a99e733..d58b48a 100644 (file)
@@ -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