From 09de96eb4b52af8c0a824c9063da623f9cfc6433 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 11 Sep 2019 14:56:24 -0700 Subject: [PATCH] Cleanup Title::touchLinks() to use JobQueueGroup::lazyPush() in one batch Change-Id: I45f36a06cc333170f60162ee37b464865b6bdc37 --- includes/Title.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 81c68767e0..bdff7a759f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4270,12 +4270,21 @@ class Title implements LinkTarget, IDBAccessObject { * on the number of links. Typically called on create and delete. */ public function touchLinks() { - DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks', 'page-touch' ) ); + $jobs = []; + $jobs[] = HTMLCacheUpdateJob::newForBacklinks( + $this, + 'pagelinks', + [ 'causeAction' => 'page-touch' ] + ); if ( $this->mNamespace == NS_CATEGORY ) { - DeferredUpdates::addUpdate( - new HTMLCacheUpdate( $this, 'categorylinks', 'category-touch' ) + $jobs[] = HTMLCacheUpdateJob::newForBacklinks( + $this, + 'categorylinks', + [ 'causeAction' => 'category-touch' ] ); } + + JobQueueGroup::singleton()->lazyPush( $jobs ); } /** -- 2.20.1