From: Aaron Schulz Date: Tue, 17 Apr 2018 00:11:42 +0000 (-0700) Subject: Migrate PurgeJobUtils callback to AutoCommitUpdate X-Git-Tag: 1.34.0-rc.0~5709^2 X-Git-Url: http://git.cyclocoop.org/%27%40script%40/ecrire/?a=commitdiff_plain;h=2e3dcdab2b69b1d1e166727e12f478f265ac293d;p=lhc%2Fweb%2Fwiklou.git Migrate PurgeJobUtils callback to AutoCommitUpdate Since it calls LBFactory::commitAndWaitForReplication, blocking for an unknown amount of time, it is a bit "heavyweight" to be the sort of quick update that uses onTransactionIdle(). Change-Id: Ic3476de5b61a7cd5f31ba487b186f9605a3b2774 --- diff --git a/includes/jobqueue/utils/PurgeJobUtils.php b/includes/jobqueue/utils/PurgeJobUtils.php index ba80c8e450..5d8a6cf243 100644 --- a/includes/jobqueue/utils/PurgeJobUtils.php +++ b/includes/jobqueue/utils/PurgeJobUtils.php @@ -37,7 +37,9 @@ class PurgeJobUtils { return; } - $dbw->onTransactionIdle( + DeferredUpdates::addUpdate( new AutoCommitUpdate( + $dbw, + __METHOD__, function () use ( $dbw, $namespace, $dbkeys ) { $services = MediaWikiServices::getInstance(); $lbFactory = $services->getDBLoadBalancerFactory(); @@ -74,8 +76,7 @@ class PurgeJobUtils { ); $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket ); } - }, - __METHOD__ - ); + } + ) ); } }