From: Aaron Schulz Date: Wed, 11 Sep 2019 22:09:07 +0000 (-0700) Subject: Cleanup File::purgeEverything() to use JobQueueGroup::lazyPush() in one batch X-Git-Tag: 1.34.0-rc.0~223^2~1 X-Git-Url: http://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=2bb26430fafeb336641c8477bebc12dbab5a4c8c;p=lhc%2Fweb%2Fwiklou.git Cleanup File::purgeEverything() to use JobQueueGroup::lazyPush() in one batch Change-Id: I347de55ecca4d2779eba6a8627276b9afef48905 --- 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 ); } }