build: Upgrade mediawiki-codesniffer from 26.0.0 to 28.0.0
[lhc/web/wiklou.git] / maintenance / populateChangeTagDef.php
index 9594137..2be690b 100644 (file)
@@ -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 ) {