X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJobQueueGroup.php;h=5bd1cc94a858b843af4a8c82b70de10014f380cd;hb=f5772f54126d489e31781d34db3db989992fa108;hp=72d2537ee193f39032affc1e3155a83820cadd28;hpb=759b2b736fe28a5b2a4c6376bcedfb3ef9bf805f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/JobQueueGroup.php b/includes/jobqueue/JobQueueGroup.php index 72d2537ee1..5bd1cc94a8 100644 --- a/includes/jobqueue/JobQueueGroup.php +++ b/includes/jobqueue/JobQueueGroup.php @@ -28,7 +28,7 @@ * @since 1.21 */ class JobQueueGroup { - /** @var array */ + /** @var JobQueueGroup[] */ protected static $instances = array(); /** @var ProcessCacheLRU */ @@ -166,10 +166,11 @@ class JobQueueGroup { * @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(); + } } /** @@ -415,8 +416,8 @@ class JobQueueGroup { 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." ); } } }