From: Tim Starling Date: Mon, 25 Jul 2005 07:03:01 +0000 (+0000) Subject: profiling, fixed incorrect transaction handling (my fault) X-Git-Tag: 1.5.0beta4~34 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=fcc8c224ffba4c2b4079f2c3781acd1f41466be5;p=lhc%2Fweb%2Fwiklou.git profiling, fixed incorrect transaction handling (my fault) --- diff --git a/includes/Article.php b/includes/Article.php index 9f0e3b08c3..1ffe6568cf 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1032,6 +1032,7 @@ class Article { global $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer; $fname = 'Article::insertNewArticle'; + wfProfileIn( $fname ); $this->mGoodAdjustment = $this->isCountable( $text ); $this->mTotalAdjustment = 1; @@ -1093,6 +1094,7 @@ class Article { $oldid = 0; # new article $this->showArticle( $text, wfMsg( 'newarticle' ), false, $isminor, $now, $summary, $oldid ); + wfProfileOut( $fname ); } function getTextOfLastEditWithSectionReplacedOrAdded($section, $text, $summary = '', $edittime = NULL) { @@ -1190,6 +1192,7 @@ class Article { global $wgUseSquid, $wgInternalServer, $wgPostCommitUpdateList, $wgUseFileCache; $fname = 'Article::updateArticle'; + wfProfileIn( $fname ); $good = true; $isminor = ( $minor && $wgUser->isLoggedIn() ); @@ -1239,6 +1242,7 @@ class Article { 'text' => $text ) ); + $dbw->immediateCommit(); $dbw->begin(); $revisionId = $revision->insertOn( $dbw ); @@ -1304,6 +1308,7 @@ class Article { $this->showArticle( $text, wfMsg( 'updated' ), $sectionanchor, $isminor, $now, $summary, $lastRevision ); } + wfProfileOut( $fname ); return $good; } @@ -1315,6 +1320,9 @@ class Article { global $wgUseDumbLinkUpdate, $wgAntiLockFlags, $wgOut, $wgUser, $wgLinkCache, $wgEnotif; global $wgUseEnotif; + $fname = 'Article::showArticle'; + wfProfileIn( $fname ); + $wgLinkCache = new LinkCache(); if ( !$wgUseDumbLinkUpdate ) { @@ -1359,6 +1367,7 @@ class Article { $wgEnotif = new EmailNotification (); $wgEnotif->notifyOnPageChange( $this->mTitle, $now, $summary, $me2, $oldid ); } + wfProfileOut( $fname ); } /** @@ -2088,6 +2097,9 @@ class Article { $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); $recentchanges = $dbw->tableName( 'recentchanges' ); $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}'"; + //$dbw->query( $sql ); // HACK: disabled for now, slowness + + // re-enabled for commit of unrelated live changes -- TS $dbw->query( $sql ); } $id = $this->getID();