From: Tim Starling Date: Thu, 10 Mar 2011 04:47:21 +0000 (+0000) Subject: Some bug fixes for r83634. X-Git-Tag: 1.31.0-rc.0~31531 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=31851e18cfe03cce03a8c9bd6a62b79abb1b4c81;p=lhc%2Fweb%2Fwiklou.git Some bug fixes for r83634. --- 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 {