Merge "Move callers away from Title::GAID_FOR_UPDATE"
[lhc/web/wiklou.git] / includes / deferred / LinksUpdate.php
index 5b68ff8..8345ee6 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 */
@@ -125,7 +125,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate {
 
                if ( !$this->mId ) {
                        // NOTE: subclasses may initialize mId before calling this constructor!
-                       $this->mId = $title->getArticleID( Title::GAID_FOR_UPDATE );
+                       $this->mId = $title->getArticleID( Title::READ_LATEST );
                }
 
                if ( !$this->mId ) {
@@ -212,7 +212,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate {
         * @since 1.27
         */
        public static function acquirePageLock( IDatabase $dbw, $pageId, $why = 'atomicity' ) {
-               $key = "LinksUpdate:$why:pageid:$pageId";
+               $key = "{$dbw->getDomainID()}:LinksUpdate:$why:pageid:$pageId"; // per-wiki
                $scopedLock = $dbw->getScopedLockAndFlush( $key, __METHOD__, 15 );
                if ( !$scopedLock ) {
                        $logger = LoggerFactory::getInstance( 'SecondaryDataUpdate' );
@@ -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()
-                       )
-               ];
-       }
 }