Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382990 )

Change subject: Add config var for disabling inject RC records
......................................................................

Add config var for disabling inject RC records

I tried to keep it as minimal as possible to make iit easy to backport

Bug: T171027
Change-Id: I239ba4685e1eaf260ff4c7c0ea326d0155d83828
---
M client/config/WikibaseClient.default.php
M client/includes/Changes/ChangeHandler.php
M client/includes/WikibaseClient.php
3 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/90/382990/1

diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index f0df283..31db25b 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -110,6 +110,9 @@
                                ? $settings->getSetting( 
'wikiPageUpdaterDbBatchSize' )
                                : $mainConfig->get( 'UpdateRowsPerJob' );
                },
+
+               // Temp. See T171027
+               'disableInjectRCRecords' => false,
        ];
 
        // Some defaults depend on information not available at this time.
diff --git a/client/includes/Changes/ChangeHandler.php 
b/client/includes/Changes/ChangeHandler.php
index d14fb8a..62b027e 100644
--- a/client/includes/Changes/ChangeHandler.php
+++ b/client/includes/Changes/ChangeHandler.php
@@ -50,11 +50,17 @@
        private $siteLookup;
 
        /**
+        * @var bool
+        */
+       private $disableInjectRCRecords;
+
+       /**
         * @param AffectedPagesFinder $affectedPagesFinder
         * @param TitleFactory $titleFactory
         * @param PageUpdater $updater
         * @param ChangeRunCoalescer $changeRunCoalescer
         * @param SiteLookup $siteLookup
+        * @param bool $disableInjectRCRecords
         *
         * @throws InvalidArgumentException
         */
@@ -63,13 +69,15 @@
                TitleFactory $titleFactory,
                PageUpdater $updater,
                ChangeRunCoalescer $changeRunCoalescer,
-               SiteLookup $siteLookup
+               SiteLookup $siteLookup,
+               $disableInjectRCRecords = false
        ) {
                $this->affectedPagesFinder = $affectedPagesFinder;
                $this->titleFactory = $titleFactory;
                $this->updater = $updater;
                $this->changeRunCoalescer = $changeRunCoalescer;
                $this->siteLookup = $siteLookup;
+               $this->disableInjectRCRecords = $disableInjectRCRecords;
        }
 
        /**
@@ -129,6 +137,10 @@
                // NOTE: signature depends on change ID, effectively disabling 
deduplication
                $changeSignature = $this->getChangeSignature( $change );
                $rootJobParams['rootJobSignature'] = $titleBatchSignature . '&' 
. $changeSignature;
+
+               if ( $this->disableInjectRCRecords === true ) {
+                       return;
+               }
                $this->updater->injectRCRecords( $titlesToUpdate, $change, 
$rootJobParams );
        }
 
diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 256042c..b1aadeb 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -1169,7 +1169,8 @@
                        new TitleFactory(),
                        $pageUpdater,
                        $changeListTransformer,
-                       $this->siteLookup
+                       $this->siteLookup,
+                       $this->settings->getSetting( 'disableInjectRCRecords' )
                );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/382990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I239ba4685e1eaf260ff4c7c0ea326d0155d83828
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to