From 31851e18cfe03cce03a8c9bd6a62b79abb1b4c81 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 10 Mar 2011 04:47:21 +0000 Subject: [PATCH] Some bug fixes for r83634. --- maintenance/nextJobDB.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maintenance/nextJobDB.php b/maintenance/nextJobDB.php index 5d01650022..2d3608d510 100644 --- a/maintenance/nextJobDB.php +++ b/maintenance/nextJobDB.php @@ -62,6 +62,7 @@ class nextJobDB extends Maintenance { return; } + $candidates = array_values( $candidates ); $db = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ]; if ( !$this->checkJob( $type, $db ) ) { // This job is not available in the current database. Remove it from @@ -86,9 +87,9 @@ class nextJobDB extends Maintenance { * Check if the specified database has a job of the specified type in it. * The type may be false to indicate "all". */ - function checkJob( $type, $db ) { - $lb = wfGetLB( $db ); - $db = $lb->getConnection( DB_MASTER ); + function checkJob( $type, $dbName ) { + $lb = wfGetLB( $dbName ); + $db = $lb->getConnection( DB_MASTER, array(), $dbName ); if ( $type === false ) { $conds = array(); } else { -- 2.20.1