jenkins-bot has submitted this change and it was merged.

Change subject: Don't queue refreshLinks jobs on null edit
......................................................................


Don't queue refreshLinks jobs on null edit

Bug 50785: don't queue refreshLinks jobs on null edit or API
action=purge forcelinkupdate=1, since these actions are commonly
performed in order to clear the cache of a single page, and queueing
millions of jobs is not the response the user usually expects.

Change-Id: I2dbb5d21fa6b876adefd6bcfc93a83c5904d8d13
---
M includes/WikiPage.php
M includes/api/ApiPurge.php
2 files changed, 16 insertions(+), 5 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  Umherirrender: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/WikiPage.php b/includes/WikiPage.php
index 398a424..48eaf2b 100644
--- a/includes/WikiPage.php
+++ b/includes/WikiPage.php
@@ -2071,7 +2071,9 @@
 
                // Update the links tables and other secondary data
                if ( $content ) {
-                       $updates = $content->getSecondaryDataUpdates( 
$this->getTitle(), null, true, $editInfo->output );
+                       $recursive = $options['changed']; // bug 50785
+                       $updates = $content->getSecondaryDataUpdates(
+                               $this->getTitle(), null, $recursive, 
$editInfo->output );
                        DataUpdate::runUpdates( $updates );
                }
 
diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php
index b68dc5c..e2eae61 100644
--- a/includes/api/ApiPurge.php
+++ b/includes/api/ApiPurge.php
@@ -64,6 +64,7 @@
                $params = $this->extractRequestParams();
 
                $forceLinkUpdate = $params['forcelinkupdate'];
+               $forceRecursiveLinkUpdate = $params['forcerecursivelinkupdate'];
                $pageSet = $this->getPageSet();
                $pageSet->execute();
 
@@ -82,7 +83,7 @@
                        $page->doPurge(); // Directly purge and skip the UI 
part of purge().
                        $r['purged'] = '';
 
-                       if ( $forceLinkUpdate ) {
+                       if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
                                if ( !$this->getUser()->pingLimiter() ) {
                                        global $wgEnableParserCache;
 
@@ -93,7 +94,8 @@
                                        $p_result = $content->getParserOutput( 
$title, $page->getLatest(), $popts, $wgEnableParserCache );
 
                                        # Update the links tables
-                                       $updates = 
$content->getSecondaryDataUpdates( $title, null, true, $p_result );
+                                       $updates = 
$content->getSecondaryDataUpdates(
+                                               $title, null, 
$forceRecursiveLinkUpdate, $p_result );
                                        DataUpdate::runUpdates( $updates );
 
                                        $r['linkupdate'] = '';
@@ -150,7 +152,10 @@
        }
 
        public function getAllowedParams( $flags = 0 ) {
-               $result = array( 'forcelinkupdate' => false );
+               $result = array(
+                       'forcelinkupdate' => false,
+                       'forcerecursivelinkupdate' => false
+               );
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags 
);
                }
@@ -159,7 +164,11 @@
 
        public function getParamDescription() {
                return $this->getPageSet()->getFinalParamDescription()
-                       + array( 'forcelinkupdate' => 'Update the links tables' 
);
+                       + array(
+                               'forcelinkupdate' => 'Update the links tables',
+                               'forcerecursivelinkupdate' => 'Update the links 
table, and update ' .
+                                       'the links tables for any page that 
uses this page as a template',
+                       );
        }
 
        public function getResultProperties() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dbb5d21fa6b876adefd6bcfc93a83c5904d8d13
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to