From ed95a3e6d933688bc35ca955788d5e9569625e98 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 30 Sep 2018 16:59:56 +0200 Subject: [PATCH] Fix caller name in PurgeJobUtils::invalidatePages Seeing {closure} in the logs as caller is not helpful Change-Id: I252b23e46983b359cbad32323c3a063e7a7afcb5 --- includes/jobqueue/utils/PurgeJobUtils.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/jobqueue/utils/PurgeJobUtils.php b/includes/jobqueue/utils/PurgeJobUtils.php index 5d8a6cf243..ef364b54fe 100644 --- a/includes/jobqueue/utils/PurgeJobUtils.php +++ b/includes/jobqueue/utils/PurgeJobUtils.php @@ -36,11 +36,12 @@ class PurgeJobUtils { if ( $dbkeys === [] ) { return; } + $fname = __METHOD__; DeferredUpdates::addUpdate( new AutoCommitUpdate( $dbw, __METHOD__, - function () use ( $dbw, $namespace, $dbkeys ) { + function () use ( $dbw, $namespace, $dbkeys, $fname ) { $services = MediaWikiServices::getInstance(); $lbFactory = $services->getDBLoadBalancerFactory(); // Determine which pages need to be updated. @@ -55,7 +56,7 @@ class PurgeJobUtils { 'page_title' => $dbkeys, 'page_touched < ' . $dbw->addQuotes( $now ) ], - __METHOD__ + $fname ); if ( !$ids ) { @@ -63,7 +64,7 @@ class PurgeJobUtils { } $batchSize = $services->getMainConfig()->get( 'UpdateRowsPerQuery' ); - $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ ); + $ticket = $lbFactory->getEmptyTransactionTicket( $fname ); foreach ( array_chunk( $ids, $batchSize ) as $idBatch ) { $dbw->update( 'page', @@ -72,9 +73,9 @@ class PurgeJobUtils { 'page_id' => $idBatch, 'page_touched < ' . $dbw->addQuotes( $now ) // handle races ], - __METHOD__ + $fname ); - $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket ); + $lbFactory->commitAndWaitForReplication( $fname, $ticket ); } } ) ); -- 2.20.1