From: Aaron Schulz Date: Tue, 13 Sep 2016 02:56:37 +0000 (-0700) Subject: Avoid using deprecated methods in JobQueueDB X-Git-Tag: 1.31.0-rc.0~5628^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=fca4beb30281e302148614ff0d1f3dca1fddeb6b;p=lhc%2Fweb%2Fwiklou.git Avoid using deprecated methods in JobQueueDB Change-Id: Ib35b8792e3e4902b52c3e708d8c6e756f35986bd --- diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index f6b4d53db1..50727a2cc9 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -20,6 +20,7 @@ * @file * @author Aaron Schulz */ +use MediaWiki\MediaWikiServices; /** * Class to handle job queues stored in the DB @@ -526,7 +527,8 @@ class JobQueueDB extends JobQueue { * @return void */ protected function doWaitForBackups() { - wfWaitForSlaves( false, $this->wiki, $this->cluster ?: false ); + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $lbFactory->waitForReplication( [ 'wiki' => $this->wiki, 'cluster' => $this->cluster ] ); } /** @@ -755,9 +757,10 @@ class JobQueueDB extends JobQueue { * @return DBConnRef */ protected function getDB( $index ) { + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $lb = ( $this->cluster !== false ) - ? wfGetLBFactory()->getExternalLB( $this->cluster, $this->wiki ) - : wfGetLB( $this->wiki ); + ? $lbFactory->getExternalLB( $this->cluster, $this->wiki ) + : $lbFactory->getMainLB( $this->wiki ); return $lb->getConnectionRef( $index, [], $this->wiki ); }