*/
public function postSendUpdates() {
try {
- JobQueueGroup::singleton()->pushLazyJobs();
+ JobQueueGroup::pushLazyJobs();
$this->triggerJobs();
$this->restInPeace();
} catch ( Exception $e ) {
DeferredUpdates::doUpdates( 'commit' );
// Make sure any lazy jobs are pushed
- JobQueueGroup::singleton()->pushLazyJobs();
+ JobQueueGroup::pushLazyJobs();
// Log profiling data, e.g. in the database or UDP
wfLogProfilingData();
* @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();
+ }
}
/**
$n = count( $this->bufferedJobs );
if ( $n > 0 ) {
trigger_error( __METHOD__ . ": $n buffered job(s) never inserted." );
- $this->pushLazyJobs(); // try to do it now
}
}
}