http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83636

Revision: 83636
Author:   tstarling
Date:     2011-03-10 04:47:21 +0000 (Thu, 10 Mar 2011)
Log Message:
-----------
Some bug fixes for r83634.

Modified Paths:
--------------
    trunk/phase3/maintenance/nextJobDB.php

Modified: trunk/phase3/maintenance/nextJobDB.php
===================================================================
--- trunk/phase3/maintenance/nextJobDB.php      2011-03-10 04:12:33 UTC (rev 
83635)
+++ trunk/phase3/maintenance/nextJobDB.php      2011-03-10 04:47:21 UTC (rev 
83636)
@@ -62,6 +62,7 @@
                                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 @@
         * 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 {


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to