From 29fcd02ef855d0d986f44a722d9b223e63532e0d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 11 Jul 2019 21:32:54 -0700 Subject: [PATCH] Make LinksUpdate no longer extend EnqueueableDataUpdate LinksUpdate does not match RefreshLinksJob since the former is only a subset of the later. Also, DeferredUpdates::doUpdates() only runs in "enqueue" mode for cases in MediaWiki::restInPeace() if there is no post-send support. In a future commit, the deferred callback in which LinksUpdate runs currently, will be abstracted into its own deferred update, which will then bring back EnqueueableDataUpdate for this update. Bug: T206283 Change-Id: I0680be445e8b8e8d0dba85df135b84640f4fcb81 --- includes/deferred/LinksUpdate.php | 37 +------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 603e49c5ac..74e236fd4d 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -32,7 +32,7 @@ use Wikimedia\ScopedCallback; * * See docs/deferred.txt */ -class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { +class LinksUpdate extends DataUpdate { // @todo make members protected, but make sure extensions don't break /** @var int Page ID of the article linked from */ @@ -1192,39 +1192,4 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { return $this->db; } - - public function getAsJobSpecification() { - if ( $this->user ) { - $userInfo = [ - 'userId' => $this->user->getId(), - 'userName' => $this->user->getName(), - ]; - } else { - $userInfo = false; - } - - if ( $this->mRevision ) { - $triggeringRevisionId = $this->mRevision->getId(); - } else { - $triggeringRevisionId = false; - } - - return [ - 'domain' => $this->getDB()->getDomainID(), - 'job' => new JobSpecification( - 'refreshLinksPrioritized', - [ - // Reuse the parser cache if it was saved - 'rootJobTimestamp' => $this->mParserOutput->getCacheTime(), - 'useRecursiveLinksUpdate' => $this->mRecursive, - 'triggeringUser' => $userInfo, - 'triggeringRevisionId' => $triggeringRevisionId, - 'causeAction' => $this->getCauseAction(), - 'causeAgent' => $this->getCauseAgent() - ], - [ 'removeDuplicates' => true ], - $this->getTitle() - ) - ]; - } } -- 2.20.1