* @since 1.21
*/
class JobQueueGroup {
- /** @var array */
+ /** @var JobQueueGroup[] */
protected static $instances = array();
/** @var ProcessCacheLRU */
* @return void
* @since 1.26
*/
- public function pushLazyJobs() {
- $this->push( $this->bufferedJobs );
-
- $this->bufferedJobs = array();
+ public static function pushLazyJobs() {
+ foreach ( self::$instances as $group ) {
+ $group->push( $group->bufferedJobs );
+ $group->bufferedJobs = array();
+ }
}
/**
function __destruct() {
$n = count( $this->bufferedJobs );
if ( $n > 0 ) {
- trigger_error( __METHOD__ . ": $n buffered job(s) never inserted." );
- $this->pushLazyJobs(); // try to do it now
+ $type = implode( ', ', array_unique( array_map( 'get_class', $this->bufferedJobs ) ) );
+ trigger_error( __METHOD__ . ": $n buffered job(s) of type(s) $type never inserted." );
}
}
}