From 2bb26430fafeb336641c8477bebc12dbab5a4c8c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 11 Sep 2019 15:09:07 -0700 Subject: [PATCH] Cleanup File::purgeEverything() to use JobQueueGroup::lazyPush() in one batch Change-Id: I347de55ecca4d2779eba6a8627276b9afef48905 --- includes/filerepo/file/File.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 0d5776bba2..60d4e29dac 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1467,13 +1467,15 @@ abstract class File implements IDBAccessObject { // Delete thumbnails and refresh file metadata cache $this->purgeCache(); $this->purgeDescription(); - // Purge cache of all pages using this file $title = $this->getTitle(); if ( $title ) { - DeferredUpdates::addUpdate( - new HTMLCacheUpdate( $title, 'imagelinks', 'file-purge' ) + $job = HTMLCacheUpdateJob::newForBacklinks( + $title, + 'imagelinks', + [ 'causeAction' => 'file-purge' ] ); + JobQueueGroup::singleton()->lazyPush( $job ); } } -- 2.20.1