X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupRemovedModules.php;h=a4e66ca63b651995c8d07fa9ec4773d815c5bcff;hb=1632780c2d4b804120fd06ddb4d8c9928c0dd7fb;hp=cc8b02488f4040eeb01401b2377b76bb83bd60ee;hpb=ed945112a8640fcaefa0128456602893294aee31;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupRemovedModules.php b/maintenance/cleanupRemovedModules.php index cc8b02488f..a4e66ca63b 100644 --- a/maintenance/cleanupRemovedModules.php +++ b/maintenance/cleanupRemovedModules.php @@ -36,22 +36,14 @@ class CleanupRemovedModules extends Maintenance { parent::__construct(); $this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database'; $this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true ); - $this->addOption( - 'max-slave-lag', - 'If the slave lag exceeds this many seconds, wait until it drops below this value. ' - . 'Default: 5', - false, - true - ); } public function execute() { $dbw = wfGetDB( DB_MASTER ); - $rl = new ResourceLoader(); + $rl = new ResourceLoader( ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) ); $moduleNames = $rl->getModuleNames(); $moduleList = implode( ', ', array_map( array( $dbw, 'addQuotes' ), $moduleNames ) ); $limit = max( 1, intval( $this->getOption( 'batchsize', 500 ) ) ); - $maxlag = intval( $this->getOption( 'max-slave-lag', 5 ) ); $this->output( "Cleaning up module_deps table...\n" ); $i = 1; @@ -63,7 +55,7 @@ class CleanupRemovedModules extends Maintenance { $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; - wfWaitForSlaves( $maxlag ); + wfWaitForSlaves(); } while ( $numRows > 0 ); $this->output( "done\n" ); @@ -77,7 +69,7 @@ class CleanupRemovedModules extends Maintenance { $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; - wfWaitForSlaves( $maxlag ); + wfWaitForSlaves(); } while ( $numRows > 0 ); $this->output( "done\n" ); @@ -90,7 +82,7 @@ class CleanupRemovedModules extends Maintenance { $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; - wfWaitForSlaves( $maxlag ); + wfWaitForSlaves(); } while ( $numRows > 0 ); $this->output( "done\n" ); }