From: Demon Date: Mon, 28 Jan 2013 19:10:47 +0000 (+0000) Subject: Merge "Improved handling of pending queue delisting." X-Git-Tag: 1.31.0-rc.0~20873 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=d326b2c8da83613278831c7749051d15f7bc2855;p=lhc%2Fweb%2Fwiklou.git Merge "Improved handling of pending queue delisting." --- d326b2c8da83613278831c7749051d15f7bc2855 diff --cc maintenance/nextJobDB.php index 9b83bf9ca2,7e6fd966db..16c6070e1c --- a/maintenance/nextJobDB.php +++ b/maintenance/nextJobDB.php @@@ -124,13 -106,22 +118,26 @@@ class nextJobDB extends Maintenance } } while ( $again ); - $this->output( $db . "\n" ); + if ( $this->hasOption( 'types' ) ) { + $this->output( $db . " " . $type . "\n" ); + } else { + $this->output( $db . "\n" ); + } } + private function delistDB( array $pendingDBs, $db, $type ) { + if ( $type === false ) { + // There are no jobs available in the current database + foreach ( $pendingDBs as $type2 => $dbs ) { + $pendingDBs[$type2] = array_diff( $pendingDBs[$type2], array( $db ) ); + } + } else { + // There are no jobs of this type available in the current database + $pendingDBs[$type] = array_diff( $pendingDBs[$type], array( $db ) ); + } + return $pendingDBs; + } + /** * Check if the specified database has a job of the specified type in it. * The type may be false to indicate "all".