From: Aaron Schulz Date: Wed, 31 Oct 2012 22:24:52 +0000 (-0700) Subject: Fixed nextJobDB.php to handle recent job queue changes. X-Git-Tag: 1.31.0-rc.0~21789 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=f061ce7ffa6e46c374da0ff63f9a267544c9c311;p=lhc%2Fweb%2Fwiklou.git Fixed nextJobDB.php to handle recent job queue changes. Change-Id: I98533ed599d27bbfc9043e906a758e3bc8903de0 --- 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; }