X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateChangeTagDef.php;h=2be690b08df8adaae4f060c753f3de9cfc09b106;hb=a997803cd6cf97da234e6d5b363e135806a7414b;hp=9594137de1b46cbd621c9af24ff52f9e2f9b5b46;hpb=954327b642fcf869aab7fa75dd58a82935f9d2e1;p=lhc%2Fweb%2Fwiklou.git 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 ) {