$this->setBatchSize( 1000 );
$this->addOption(
'sleep',
- 'Sleep time (in seconds) between every batch',
+ 'Sleep time (in seconds) between every batch, defaults to zero',
false,
true
);
$this->addOption( 'set-user-tags-only', 'Only update ctd_user_defined from valid_tag table' );
}
- public function execute() {
- global $wgChangeTagsSchemaMigrationStage;
- if ( $wgChangeTagsSchemaMigrationStage === MIGRATION_OLD ) {
- // Return "success", but don't flag it as done so the next run will retry
- $this->output( '... Not run, $wgChangeTagsSchemaMigrationStage === MIGRATION_OLD' . "\n" );
- return true;
- }
- return parent::execute();
- }
-
protected function doDBUpdates() {
$this->lbFactory = MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$this->setBatchSize( $this->getOption( 'batch-size', $this->getBatchSize() ) );
private function backpopulateChangeTagPerTag( $tagName, $tagId ) {
$dbr = $this->lbFactory->getMainLB()->getConnection( DB_REPLICA );
$dbw = $this->lbFactory->getMainLB()->getConnection( DB_MASTER );
- $sleep = (int)$this->getOption( 'sleep', 10 );
+ $sleep = (int)$this->getOption( 'sleep', 0 );
$lastId = 0;
$this->output( "Starting to add ct_tag_id = {$tagId} for ct_tag = {$tagName}\n" );
while ( true ) {