From: Aaron Schulz Date: Mon, 8 Aug 2016 21:55:56 +0000 (-0700) Subject: Use MediaWikiServices in restInPeace() for load balancer factory X-Git-Tag: 1.31.0-rc.0~6125 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=bf5b5d766405ffa489261ac1e819e6812892c3ce;p=lhc%2Fweb%2Fwiklou.git Use MediaWikiServices in restInPeace() for load balancer factory Change-Id: Icc12100bd3409900c848c72a31417a8c25ae1021 --- 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 );