X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildFileCache.php;h=0b5b9b04e3b0e77a12890b4b8d09ff817c5bcbb6;hb=d1000765e7ee710bf892e3772afdabfb5f6b1f6c;hp=fe3944c8764dce534ba854c8aede865800e3b996;hpb=732b5e2745ca8f6153e19cc10c3c9acb1b2a6331;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index fe3944c876..0b5b9b04e3 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -60,24 +60,25 @@ class RebuildFileCache extends Maintenance { global $wgRequestTime; if ( !$this->enabled ) { - $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true ); + $this->fatalError( "Nothing to do -- \$wgUseFileCache is disabled." ); } $start = $this->getOption( 'start', "0" ); if ( !ctype_digit( $start ) ) { - $this->error( "Invalid value for start parameter.", true ); + $this->fatalError( "Invalid value for start parameter." ); } $start = intval( $start ); $end = $this->getOption( 'end', "0" ); if ( !ctype_digit( $end ) ) { - $this->error( "Invalid value for end parameter.", true ); + $this->fatalError( "Invalid value for end parameter." ); } $end = intval( $end ); $this->output( "Building content page file cache from page {$start}!\n" ); $dbr = $this->getDB( DB_REPLICA ); + $batchSize = $this->getBatchSize(); $overwrite = $this->hasOption( 'overwrite' ); $start = ( $start > 0 ) ? $start @@ -86,15 +87,15 @@ class RebuildFileCache extends Maintenance { ? $end : $dbr->selectField( 'page', 'MAX(page_id)', false, __METHOD__ ); if ( !$start ) { - $this->error( "Nothing to do.", true ); + $this->fatalError( "Nothing to do." ); } $_SERVER['HTTP_ACCEPT_ENCODING'] = 'bgzip'; // hack, no real client # Do remaining chunk - $end += $this->mBatchSize - 1; + $end += $batchSize - 1; $blockStart = $start; - $blockEnd = $start + $this->mBatchSize - 1; + $blockEnd = $start + $batchSize - 1; $dbw = $this->getDB( DB_MASTER ); // Go through each page and save the output @@ -171,8 +172,8 @@ class RebuildFileCache extends Maintenance { } $this->commitTransaction( $dbw, __METHOD__ ); // commit any changes (just for sanity) - $blockStart += $this->mBatchSize; - $blockEnd += $this->mBatchSize; + $blockStart += $batchSize; + $blockEnd += $batchSize; } $this->output( "Done!\n" ); }