X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateArticleCount.php;h=55f535d20e3401eea9a0165ea010959cd8a699f1;hb=ff707bba775134de0b39cfb5f643387e53d56caa;hp=470647a4c4f9e0c705bd4ddcab1621042d1faba9;hpb=de31b2474e29fe2f2eea6648b83d01ee53a726b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateArticleCount.php b/maintenance/updateArticleCount.php index 470647a4c4..55f535d20e 100644 --- a/maintenance/updateArticleCount.php +++ b/maintenance/updateArticleCount.php @@ -37,12 +37,18 @@ class UpdateArticleCount extends Maintenance { parent::__construct(); $this->mDescription = "Count of the number of articles and update the site statistics table"; $this->addOption( 'update', 'Update the site_stats table with the new count' ); + $this->addOption( 'use-master', 'Count using the master database' ); } public function execute() { $this->output( "Counting articles..." ); - $counter = new SiteStatsInit( false ); + if ( $this->hasOption( 'use-master' ) ) { + $dbr = wfGetDB( DB_MASTER ); + } else { + $dbr = wfGetDB( DB_SLAVE, 'vslow' ); + } + $counter = new SiteStatsInit( $dbr ); $result = $counter->articles(); $this->output( "found {$result}.\n" );