Convert doBatchPushInternal to use startAtomic/endAtomic
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 7 Oct 2015 18:03:35 +0000 (11:03 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 7 Oct 2015 18:03:35 +0000 (11:03 -0700)
This is less likely to cause nesting problems if the main
DB is used for the job table (e.g. stock installs)

Change-Id: I4c72688bd5d07a6b0626958869e6b386babbc5b3

includes/jobqueue/JobQueueDB.php

index d1e4a13..7907614 100644 (file)
@@ -177,7 +177,7 @@ class JobQueueDB extends JobQueue {
 
        /**
         * @see JobQueue::doBatchPush()
-        * @param array $jobs
+        * @param IJobSpecification[] $jobs
         * @param int $flags
         * @throws DBError|Exception
         * @return void
@@ -198,7 +198,7 @@ class JobQueueDB extends JobQueue {
         * This function should *not* be called outside of JobQueueDB
         *
         * @param IDatabase $dbw
-        * @param array $jobs
+        * @param IJobSpecification[] $jobs
         * @param int $flags
         * @param string $method
         * @throws DBError
@@ -221,7 +221,7 @@ class JobQueueDB extends JobQueue {
                }
 
                if ( $flags & self::QOS_ATOMIC ) {
-                       $dbw->begin( $method ); // wrap all the job additions in one transaction
+                       $dbw->startAtomic( $method ); // wrap all the job additions in one transaction
                }
                try {
                        // Strip out any duplicate jobs that are already in the queue...
@@ -256,7 +256,7 @@ class JobQueueDB extends JobQueue {
                        throw $e;
                }
                if ( $flags & self::QOS_ATOMIC ) {
-                       $dbw->commit( $method );
+                       $dbw->endAtomic( $method );
                }
 
                return;