$this->purgeThumbnails( $options );
// Purge CDN cache for this file
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $this->getUrl() );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( [ $this->getUrl() ] ),
+ DeferredUpdates::PRESEND
+ );
}
/**
foreach ( $files as $file ) {
$urls[] = $this->getArchiveThumbUrl( $archiveName, $file );
}
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $urls );
+ DeferredUpdates::addUpdate( new CdnCacheUpdate( $urls ), DeferredUpdates::PRESEND );
}
/**
$this->purgeThumbList( $dir, $files );
// Purge the CDN
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $urls );
+ DeferredUpdates::addUpdate( new CdnCacheUpdate( $urls ), DeferredUpdates::PRESEND );
}
/**
}
} else {
# Existing file page: invalidate description page cache
- $title = $wikiPage->getTitle();
- $title->invalidateCache();
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $title );
+ $wikiPage->getTitle()->invalidateCache();
+ $wikiPage->getTitle()->purgeSquid();
# Allow the new file version to be patrolled from the page footer
Article::purgePatrolFooterCache( $descId );
}
# Delete old thumbnails
$this->purgeThumbnails();
# Remove the old file from the CDN cache
- MediaWikiServices::getInstance()
- ->getHtmlCacheUpdater()->purge( $this->getUrl() );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( [ $this->getUrl() ] ),
+ DeferredUpdates::PRESEND
+ );
} else {
# Update backlink pages pointing to this title if created
LinksUpdate::queueRecursiveJobsForTable(
}
# Invalidate cache for all pages using this file
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $this->getTitle(),
- 'imagelinks',
- [ 'causeAction' => 'file-upload', 'causeAgent' => $user->getName() ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this->getTitle(), 'imagelinks', 'file-upload' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
return Status::newGood();
}
foreach ( $archiveNames as $archiveName ) {
$purgeUrls[] = $this->getArchiveUrl( $archiveName );
}
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $purgeUrls );
+ DeferredUpdates::addUpdate( new CdnCacheUpdate( $purgeUrls ), DeferredUpdates::PRESEND );
return $status;
}
$this->purgeDescription();
}
- $url = $this->getArchiveUrl( $archiveName );
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $url );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( [ $this->getArchiveUrl( $archiveName ) ] ),
+ DeferredUpdates::PRESEND
+ );
return $status;
}