Use Maintenance::setBatchSize() everywhere
authorMax Semenik <maxsem.wiki@gmail.com>
Sat, 4 Nov 2017 23:10:06 +0000 (16:10 -0700)
committerMax Semenik <maxsem.wiki@gmail.com>
Sat, 4 Nov 2017 23:10:06 +0000 (16:10 -0700)
Change-Id: Id48b95c547ddd8ea02fb1c577203f17056f38402

maintenance/copyFileBackend.php
maintenance/deleteSelfExternals.php

index 4f625fc..e2e6c6c 100644 (file)
@@ -109,7 +109,7 @@ class CopyFileBackend extends Maintenance {
                        foreach ( $srcPathsRel as $srcPathRel ) {
                                // Check up on the rate file periodically to adjust the concurrency
                                if ( $rateFile && ( !$count || ( $count % 500 ) == 0 ) ) {
                        foreach ( $srcPathsRel as $srcPathRel ) {
                                // Check up on the rate file periodically to adjust the concurrency
                                if ( $rateFile && ( !$count || ( $count % 500 ) == 0 ) ) {
-                                       $this->mBatchSize = max( 1, (int)file_get_contents( $rateFile ) );
+                                       $this->setBatchSize( max( 1, (int)file_get_contents( $rateFile ) ) );
                                        $this->output( "\tBatch size is now {$this->mBatchSize}.\n" );
                                }
                                $batchPaths[$srcPathRel] = 1; // remove duplicates
                                        $this->output( "\tBatch size is now {$this->mBatchSize}.\n" );
                                }
                                $batchPaths[$srcPathRel] = 1; // remove duplicates
@@ -136,7 +136,7 @@ class CopyFileBackend extends Maintenance {
                                foreach ( $delPathsRel as $delPathRel ) {
                                        // Check up on the rate file periodically to adjust the concurrency
                                        if ( $rateFile && ( !$count || ( $count % 500 ) == 0 ) ) {
                                foreach ( $delPathsRel as $delPathRel ) {
                                        // Check up on the rate file periodically to adjust the concurrency
                                        if ( $rateFile && ( !$count || ( $count % 500 ) == 0 ) ) {
-                                               $this->mBatchSize = max( 1, (int)file_get_contents( $rateFile ) );
+                                               $this->setBatchSize( max( 1, (int)file_get_contents( $rateFile ) ) );
                                                $this->output( "\tBatch size is now {$this->mBatchSize}.\n" );
                                        }
                                        $batchPaths[$delPathRel] = 1; // remove duplicates
                                                $this->output( "\tBatch size is now {$this->mBatchSize}.\n" );
                                        }
                                        $batchPaths[$delPathRel] = 1; // remove duplicates
index ed15fd1..f76325b 100644 (file)
@@ -33,7 +33,7 @@ class DeleteSelfExternals extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->addDescription( 'Delete self-references to $wgServer from externallinks' );
        public function __construct() {
                parent::__construct();
                $this->addDescription( 'Delete self-references to $wgServer from externallinks' );
-               $this->mBatchSize = 1000;
+               $this->setBatchSize( 1000 );
        }
 
        public function execute() {
        }
 
        public function execute() {