From: Alexandre Emsenhuber Date: Thu, 9 Dec 2010 15:59:44 +0000 (+0000) Subject: Call finalCleanup() after outputting a cached page to run the deferred update list... X-Git-Tag: 1.31.0-rc.0~33419 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=6f686426ea7515f5ff4c843bcf8b777c17dc39e4;p=lhc%2Fweb%2Fwiklou.git Call finalCleanup() after outputting a cached page to run the deferred update list since Article::viewUpdates() adds a SiteStatsUpdate object to that list --- diff --git a/includes/Wiki.php b/includes/Wiki.php index ed0a135fcc..26912b35d1 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -379,19 +379,19 @@ class MediaWiki { * Do a job from the job queue */ function doJobs() { - $jobRunRate = $this->getVal( 'JobRunRate' ); + global $wgJobRunRate; - if( $jobRunRate <= 0 || wfReadOnly() ) { + if( $wgJobRunRate <= 0 || wfReadOnly() ) { return; } - if( $jobRunRate < 1 ) { + if( $wgJobRunRate < 1 ) { $max = mt_getrandmax(); - if( mt_rand( 0, $max ) > $max * $jobRunRate ) { + if( mt_rand( 0, $max ) > $max * $wgJobRunRate ) { return; } $n = 1; } else { - $n = intval( $jobRunRate ); + $n = intval( $wgJobRunRate ); } while ( $n-- && false != ( $job = Job::pop() ) ) { diff --git a/index.php b/index.php index 74698661a0..90a0601698 100644 --- a/index.php +++ b/index.php @@ -82,7 +82,10 @@ if( $wgUseFileCache && $wgTitle !== null ) { # Do any stats increment/watchlist stuff $wgArticle = MediaWiki::articleFromTitle( $wgTitle ); $wgArticle->viewUpdates(); + # Tell $wgOut that output is taken care of + $wgOut->disable(); wfProfileOut( 'main-try-filecache' ); + $mediaWiki->finalCleanup( $wgOut ); $mediaWiki->restInPeace(); exit; } @@ -96,7 +99,6 @@ $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions ); $mediaWiki->setVal( 'DisableHardRedirects', $wgDisableHardRedirects ); $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf ); $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf ); -$mediaWiki->setVal( 'JobRunRate', $wgJobRunRate ); $mediaWiki->setVal( 'Server', $wgServer ); $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage ); $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor ); @@ -104,5 +106,4 @@ $mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo ); $mediaWiki->performRequestForTitle( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest ); $mediaWiki->finalCleanup( $wgOut ); - $mediaWiki->restInPeace();