X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FpopulateChangeTagDef.php;h=2be690b08df8adaae4f060c753f3de9cfc09b106;hp=9594137de1b46cbd621c9af24ff52f9e2f9b5b46;hb=e65f8ac5110804067366f9f239c13f4f29b66c3d;hpb=f186496005a47a09aed6d46feea7302fe9d5f0e2 diff --git a/maintenance/populateChangeTagDef.php b/maintenance/populateChangeTagDef.php index 9594137de1..2be690b08d 100644 --- a/maintenance/populateChangeTagDef.php +++ b/maintenance/populateChangeTagDef.php @@ -34,7 +34,7 @@ class PopulateChangeTagDef extends LoggedUpdateMaintenance { $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 ); @@ -74,12 +74,15 @@ class PopulateChangeTagDef extends LoggedUpdateMaintenance { private function setUserDefinedTags() { $dbr = $this->lbFactory->getMainLB()->getConnection( DB_REPLICA ); - $userTags = $dbr->selectFieldValues( - 'valid_tag', - 'vt_tag', - [], - __METHOD__ - ); + $userTags = null; + if ( $dbr->tableExists( 'valid_tag' ) ) { + $userTags = $dbr->selectFieldValues( + 'valid_tag', + 'vt_tag', + [], + __METHOD__ + ); + } if ( empty( $userTags ) ) { $this->output( "No user defined tags to set, moving on...\n" ); @@ -197,7 +200,7 @@ class PopulateChangeTagDef extends LoggedUpdateMaintenance { 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 ) {