X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fdeferred%2FLinksUpdate.php;h=89136428911d133273eff58876284ee327cb8110;hb=3247bae0e7c04b2f162381358acf25b7f807f6b6;hp=dfe89ba3fa711b1ebc1251b56aac95b427fcc8e4;hpb=04a8781b3ea494cd7944e104863b3eaa34a1e733;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index dfe89ba3fa..8913642891 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -306,10 +306,13 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { * using the job queue. */ protected function queueRecursiveJobs() { - self::queueRecursiveJobsForTable( $this->mTitle, 'templatelinks' ); + $action = $this->getCauseAction(); + $agent = $this->getCauseAgent(); + + self::queueRecursiveJobsForTable( $this->mTitle, 'templatelinks', $action, $agent ); if ( $this->mTitle->getNamespace() == NS_FILE ) { // Process imagelinks in case the title is or was a redirect - self::queueRecursiveJobsForTable( $this->mTitle, 'imagelinks' ); + self::queueRecursiveJobsForTable( $this->mTitle, 'imagelinks', $action, $agent ); } $bc = $this->mTitle->getBacklinkCache(); @@ -320,7 +323,13 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { // Which ever runs first generally no-ops the other one. $jobs = []; foreach ( $bc->getCascadeProtectedLinks() as $title ) { - $jobs[] = RefreshLinksJob::newPrioritized( $title, [] ); + $jobs[] = RefreshLinksJob::newPrioritized( + $title, + [ + 'causeAction' => $action, + 'causeAgent' => $agent + ] + ); } JobQueueGroup::singleton()->push( $jobs ); } @@ -330,8 +339,12 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { * * @param Title $title Title to do job for * @param string $table Table to use (e.g. 'templatelinks') + * @param string $action Triggering action + * @param string $userName Triggering user name */ - public static function queueRecursiveJobsForTable( Title $title, $table ) { + public static function queueRecursiveJobsForTable( + Title $title, $table, $action = 'unknown', $userName = 'unknown' + ) { if ( $title->getBacklinkCache()->hasLinks( $table ) ) { $job = new RefreshLinksJob( $title, @@ -340,7 +353,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { 'recursive' => true, ] + Job::newRootJobParams( // "overall" refresh links job info "refreshlinks:{$table}:{$title->getPrefixedText()}" - ) + ) + [ 'causeAction' => $action, 'causeAgent' => $userName ] ); JobQueueGroup::singleton()->push( $job ); @@ -1042,7 +1055,9 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { $inv = [ $inv ]; } foreach ( $inv as $table ) { - DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->mTitle, $table ) ); + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $this->mTitle, $table, 'page-props' ) + ); } } } @@ -1156,6 +1171,8 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { 'useRecursiveLinksUpdate' => $this->mRecursive, 'triggeringUser' => $userInfo, 'triggeringRevisionId' => $triggeringRevisionId, + 'causeAction' => $this->getCauseAction(), + 'causeAgent' => $this->getCauseAgent() ], [ 'removeDuplicates' => true ], $this->getTitle()