$this->mDescription = "Pick a database that has pending jobs";
$this->addOption( 'type', "The type of job to search for", false, true );
}
$this->mDescription = "Pick a database that has pending jobs";
$this->addOption( 'type', "The type of job to search for", false, true );
}
public function execute() {
global $wgMemc;
$type = $this->getOption( 'type', false );
public function execute() {
global $wgMemc;
$type = $this->getOption( 'type', false );
# If we didn't get it from the cache
if( !$pendingDBs ) {
$pendingDBs = $this->getPendingDbs( $type );
$wgMemc->get( $mckey, $pendingDBs, 300 );
}
# If we didn't get it from the cache
if( !$pendingDBs ) {
$pendingDBs = $this->getPendingDbs( $type );
$wgMemc->get( $mckey, $pendingDBs, 300 );
}
foreach ( $dbsByMaster as $master => $dbs ) {
$dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] );
foreach ( $dbsByMaster as $master => $dbs ) {
$dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] );
# Padding row for MySQL bug
$sql = "(SELECT '-------------------------------------------' as db)";
foreach ( $dbs as $wikiId ) {
# Padding row for MySQL bug
$sql = "(SELECT '-------------------------------------------' as db)";
foreach ( $dbs as $wikiId ) {