Make LinksUpdate no longer extend EnqueueableDataUpdate
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 12 Jul 2019 04:32:54 +0000 (21:32 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 5 Aug 2019 17:10:33 +0000 (17:10 +0000)
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

index 603e49c..74e236f 100644 (file)
@@ -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()
-                       )
-               ];
-       }
 }