From fca4beb30281e302148614ff0d1f3dca1fddeb6b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 12 Sep 2016 19:56:37 -0700 Subject: [PATCH] Avoid using deprecated methods in JobQueueDB Change-Id: Ib35b8792e3e4902b52c3e708d8c6e756f35986bd --- includes/jobqueue/JobQueueDB.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ); } -- 2.20.1