X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateRestrictions.php;h=334ed279f65d1400f63a9fb724716114ff6f8d73;hb=fea3bbcdae4f052f769ab466df6e1f5d47d1383c;hp=2f3fc36534e179b6ffe6c5994ef77534d1823c6a;hpb=6f2565db7e082e0a2326baf3754d09b0e9ecd956;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index 2f3fc36534..334ed279f6 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -41,6 +41,7 @@ class UpdateRestrictions extends Maintenance { public function execute() { $db = $this->getDB( DB_MASTER ); + $batchSize = $this->getBatchSize(); if ( !$db->tableExists( 'page_restrictions' ) ) { $this->error( "page_restrictions table does not exist", true ); } @@ -52,9 +53,9 @@ class UpdateRestrictions extends Maintenance { $end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ ); # Do remaining chunk - $end += $this->mBatchSize - 1; + $end += $batchSize - 1; $blockStart = $start; - $blockEnd = $start + $this->mBatchSize - 1; + $blockEnd = $start + $batchSize - 1; $encodedExpiry = 'infinity'; while ( $blockEnd <= $end ) { $this->output( "...doing page_id from $blockStart to $blockEnd out of $end\n" ); @@ -105,8 +106,8 @@ class UpdateRestrictions extends Maintenance { throw new MWException( "Deadlock loop failed wtf :(" ); } } - $blockStart += $this->mBatchSize - 1; - $blockEnd += $this->mBatchSize - 1; + $blockStart += $batchSize - 1; + $blockEnd += $batchSize - 1; wfWaitForSlaves(); } $this->output( "...removing dead rows from page_restrictions\n" );