From f061ce7ffa6e46c374da0ff63f9a267544c9c311 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 31 Oct 2012 15:24:52 -0700 Subject: [PATCH] Fixed nextJobDB.php to handle recent job queue changes. Change-Id: I98533ed599d27bbfc9043e906a758e3bc8903de0 --- maintenance/nextJobDB.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/maintenance/nextJobDB.php b/maintenance/nextJobDB.php index e66e981bb6..75018dea82 100644 --- a/maintenance/nextJobDB.php +++ b/maintenance/nextJobDB.php @@ -97,17 +97,23 @@ class nextJobDB extends Maintenance { * @return bool */ function checkJob( $type, $dbName ) { - $lb = wfGetLB( $dbName ); - $db = $lb->getConnection( DB_MASTER, array(), $dbName ); + global $wgJobTypesExcludedFromDefaultQueue; + if ( $type === false ) { - $conds = Job::defaultQueueConditions( ); + $lb = wfGetLB( $dbName ); + $db = $lb->getConnection( DB_MASTER, array(), $dbName ); + $conds = array(); + if ( count( $wgJobTypesExcludedFromDefaultQueue ) > 0 ) { + foreach ( $wgJobTypesExcludedFromDefaultQueue as $cmdType ) { + $conds[] = "job_cmd != " . $db->addQuotes( $cmdType ); + } + } + $exists = (bool)$db->selectField( 'job', '1', $conds, __METHOD__ ); + $lb->reuseConnection( $db ); } else { - $conds = array( 'job_cmd' => $type ); + $exists = !JobQueueGroup::singleton( $dbName )->get( $type )->isEmpty(); } - - $exists = (bool) $db->selectField( 'job', '1', $conds, __METHOD__ ); - $lb->reuseConnection( $db ); return $exists; } -- 2.20.1