X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrefreshImageMetadata.php;h=65db94da1a727346d157a468ee857f650fe995f7;hb=801a8bdaa38cea5ff4db0440c82e9eb83e083772;hp=b7f03d9bb66128ce1211d6dd8ea8ba6993f2dfa9;hpb=f8b3f04ae6d78a13b5793a0c4e3bc7080b2c72af;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/refreshImageMetadata.php b/maintenance/refreshImageMetadata.php index b7f03d9bb6..65db94da1a 100644 --- a/maintenance/refreshImageMetadata.php +++ b/maintenance/refreshImageMetadata.php @@ -106,8 +106,9 @@ class RefreshImageMetadata extends Maintenance { $error = 0; $dbw = $this->getDB( DB_MASTER ); - if ( $this->mBatchSize <= 0 ) { - $this->error( "Batch size is too low...", 12 ); + $batchSize = $this->getBatchSize(); + if ( $batchSize <= 0 ) { + $this->fatalError( "Batch size is too low...", 12 ); } $repo = RepoGroup::singleton()->getLocalRepo(); @@ -120,7 +121,7 @@ class RefreshImageMetadata extends Maintenance { } $options = [ - 'LIMIT' => $this->mBatchSize, + 'LIMIT' => $batchSize, 'ORDER BY' => 'img_name ASC', ]; @@ -194,7 +195,7 @@ class RefreshImageMetadata extends Maintenance { } $conds2 = [ 'img_name > ' . $dbw->addQuotes( $row->img_name ) ]; wfWaitForSlaves(); - } while ( $res->numRows() === $this->mBatchSize ); + } while ( $res->numRows() === $batchSize ); $total = $upgraded + $leftAlone; if ( $force ) { @@ -254,10 +255,10 @@ class RefreshImageMetadata extends Maintenance { } if ( $brokenOnly && $force ) { - $this->error( 'Cannot use --broken-only and --force together. ', 2 ); + $this->fatalError( 'Cannot use --broken-only and --force together. ', 2 ); } } } -$maintClass = 'RefreshImageMetadata'; +$maintClass = RefreshImageMetadata::class; require_once RUN_MAINTENANCE_IF_MAIN;