X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FpopulateIpChanges.php;h=4becf6dd4d400d76eb3e5936358266d6b96dc92b;hp=40a596c8f2ca74789a81c6c03312a6ec9840c41d;hb=70a602dde40e3694f8ef8b9c779a528c17a48f42;hpb=31bc1e9c3546a97220cd7c550c57fad3d4f4304d diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index 40a596c8f2..4becf6dd4d 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -62,9 +62,14 @@ TEXT } public function doDBUpdates() { + $dbw = $this->getDB( DB_MASTER ); + + if ( !$dbw->tableExists( 'ip_changes' ) ) { + $this->fatalError( 'ip_changes table does not exist' ); + } + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); - $dbw = $this->getDB( DB_MASTER ); $throttle = intval( $this->getOption( 'throttle', 0 ) ); $maxRevId = intval( $this->getOption( 'max-rev-id', 0 ) ); $start = $this->getOption( 'rev-id', 0 ); @@ -78,7 +83,7 @@ TEXT $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); while ( $blockStart <= $end ) { - $blockEnd = min( $blockStart + $this->mBatchSize, $end ); + $blockEnd = min( $blockStart + $this->getBatchSize(), $end ); $rows = $dbr->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ],