Hooks::run( 'ArticleUndelete',
[ &$this->title, $created, $comment, $oldPageId, $restoredPages ] );
+
if ( $this->title->getNamespace() == NS_FILE ) {
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $this->title, 'imagelinks', 'file-restore' )
+ $job = HTMLCacheUpdateJob::newForBacklinks(
+ $this->title,
+ 'imagelinks',
+ [ 'causeAction' => 'file-restore' ]
);
+ JobQueueGroup::singleton()->lazyPush( $job );
}
}
if ( $this->mFile->exists() ) {
wfDebug( 'ImagePage::doPurge purging ' . $this->mFile->getName() . "\n" );
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $this->mTitle, 'imagelinks', 'file-purge' )
+ $job = HTMLCacheUpdateJob::newForBacklinks(
+ $this->mTitle,
+ 'imagelinks',
+ [ 'causeAction' => 'file-purge' ]
);
+ JobQueueGroup::singleton()->lazyPush( $job );
} else {
wfDebug( 'ImagePage::doPurge no image for '
. $this->mFile->getName() . "; limiting purge to cache only\n" );
MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title );
// Invalidate caches of articles which include this page
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $title, 'templatelinks', 'page-create' )
+ $job = HTMLCacheUpdateJob::newForBacklinks(
+ $title,
+ 'templatelinks',
+ [ 'causeAction' => 'page-create' ]
);
+ JobQueueGroup::singleton()->lazyPush( $job );
if ( $title->getNamespace() == NS_CATEGORY ) {
// Load the Category object, which will schedule a job to create
// Images
if ( $title->getNamespace() == NS_FILE ) {
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $title, 'imagelinks', 'page-delete' )
+ $job = HTMLCacheUpdateJob::newForBacklinks(
+ $title,
+ 'imagelinks',
+ [ 'causeAction' => 'page-delete' ]
);
+ JobQueueGroup::singleton()->lazyPush( $job );
}
// User talk pages
$slotsChanged = null
) {
// TODO: move this into a PageEventEmitter service
-
- if ( $slotsChanged === null || in_array( SlotRecord::MAIN, $slotsChanged ) ) {
+ $jobs = [];
+ if ( $slotsChanged === null || in_array( SlotRecord::MAIN, $slotsChanged ) ) {
// Invalidate caches of articles which include this page.
// Only for the main slot, because only the main slot is transcluded.
// TODO: MCR: not true for TemplateStyles! [SlotHandler]
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $title, 'templatelinks', 'page-edit' )
+ $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
+ $title,
+ 'templatelinks',
+ [ 'causeAction' => 'page-edit' ]
);
}
-
// Invalidate the caches of all pages which redirect here
- DeferredUpdates::addUpdate(
- new HTMLCacheUpdate( $title, 'redirect', 'page-edit' )
+ $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
+ $title,
+ 'redirect',
+ [ 'causeAction' => 'page-edit' ]
);
+ JobQueueGroup::singleton()->lazyPush( $jobs );
MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title );