*
* 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 */
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 ) {
private function invalidateProperties( $changed ) {
global $wgPagePropLinkInvalidations;
+ $jobs = [];
foreach ( $changed as $name => $value ) {
if ( isset( $wgPagePropLinkInvalidations[$name] ) ) {
$inv = $wgPagePropLinkInvalidations[$name];
$inv = [ $inv ];
}
foreach ( $inv as $table ) {
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $this->mTitle, $table, 'page-props' )
+ $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
+ $this->mTitle,
+ $table,
+ [ 'causeAction' => 'page-props' ]
);
}
}
}
+
+ JobQueueGroup::singleton()->lazyPush( $jobs );
}
/**
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()
- )
- ];
+ /**
+ * Whether or not this LinksUpdate will also update pages which transclude the
+ * current page or otherwise depend on it.
+ *
+ * @return bool
+ */
+ public function isRecursive() {
+ return $this->mRecursive;
}
}