Nemo bis has uploaded a new change for review. https://gerrit.wikimedia.org/r/178517
Change subject: updateArticleCount.php: use "vslow" DB by default, allow master ...................................................................... updateArticleCount.php: use "vslow" DB by default, allow master Similar to initSiteStats.php, SiteStatsUpdate.php. Needed by I13f866b565f665a00ec6ce61bb5073cf380bd0ff Bug: T68867 Change-Id: I061b1bd7bd4b84db5ca4ecf406980dd6981941d1 --- M maintenance/updateArticleCount.php 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/17/178517/1 diff --git a/maintenance/updateArticleCount.php b/maintenance/updateArticleCount.php index 470647a..55f535d 100644 --- a/maintenance/updateArticleCount.php +++ b/maintenance/updateArticleCount.php @@ -37,12 +37,18 @@ 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" ); -- To view, visit https://gerrit.wikimedia.org/r/178517 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I061b1bd7bd4b84db5ca4ecf406980dd6981941d1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nemo bis <federicol...@tiscali.it> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits