From bf5b5d766405ffa489261ac1e819e6812892c3ce Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 8 Aug 2016 14:55:56 -0700 Subject: [PATCH] Use MediaWikiServices in restInPeace() for load balancer factory Change-Id: Icc12100bd3409900c848c72a31417a8c25ae1021 --- includes/MediaWiki.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 21857b9e13..7dac0ec30b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -21,6 +21,7 @@ */ use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; /** * The MediaWiki class is the helper class for the index.php entry point. @@ -761,8 +762,9 @@ class MediaWiki { * @param string $mode Use 'fast' to always skip job running */ public function restInPeace( $mode = 'fast' ) { + $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); // Assure deferred updates are not in the main transaction - wfGetLBFactory()->commitMasterChanges( __METHOD__ ); + $factory->commitMasterChanges( __METHOD__ ); // Loosen DB query expectations since the HTTP client is unblocked $trxProfiler = Profiler::instance()->getTransactionProfiler(); @@ -788,7 +790,6 @@ class MediaWiki { wfLogProfilingData(); // Commit and close up! - $factory = wfGetLBFactory(); $factory->commitMasterChanges( __METHOD__ ); $factory->shutdown( LBFactory::SHUTDOWN_NO_CHRONPROT ); -- 2.20.1