Use AutoCommitUpdate instead of Database->onTransactionIdle
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueDB.php
index 924aacc..5e45730 100644 (file)
@@ -185,15 +185,13 @@ 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(
+                       wfGetDB( DB_MASTER ),
+                       __METHOD__,
+                       function ( IDatabase $dbw, $fname ) use ( $jobs, $flags ) {
+                               $this->doBatchPushInternal( $dbw, $jobs, $flags, $fname );
+                       }
+               ) );
        }
 
        /**