X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fjobqueue%2FJobQueueDB.php;h=cefe74df18f05ba400a4d673960b22864330879d;hp=540b8c5461387f2d70a5435709066ccecfa3e435;hb=82e2c924e473fa3b99bb8e0da71d99b70ec5ca07;hpb=dc1632d58ee3b016697667bfc003338141bc3ce7 diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index 540b8c5461..cefe74df18 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -18,12 +18,13 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @author Aaron Schulz */ use Wikimedia\Rdbms\IDatabase; +use Wikimedia\Rdbms\DBConnRef; +use Wikimedia\Rdbms\DBConnectionError; +use Wikimedia\Rdbms\DBError; use MediaWiki\MediaWikiServices; use Wikimedia\ScopedCallback; -use Wikimedia\Rdbms\DBConnRef; /** * Class to handle job queues stored in the DB @@ -183,14 +184,15 @@ class JobQueueDB extends JobQueue { * @return void */ protected function doBatchPush( array $jobs, $flags ) { - $dbw = $this->getMasterDB(); - - $method = __METHOD__; - $dbw->onTransactionIdle( - function () use ( $dbw, $jobs, $flags, $method ) { - $this->doBatchPushInternal( $dbw, $jobs, $flags, $method ); - }, - __METHOD__ + DeferredUpdates::addUpdate( + new AutoCommitUpdate( + $this->getMasterDB(), + __METHOD__, + function ( IDatabase $dbw, $fname ) use ( $jobs, $flags ) { + $this->doBatchPushInternal( $dbw, $jobs, $flags, $fname ); + } + ), + DeferredUpdates::PRESEND ); }