[JobQueue] Use "flush" option with commit().
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 31 Oct 2012 18:51:21 +0000 (11:51 -0700)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 1 Nov 2012 04:03:53 +0000 (04:03 +0000)
Change-Id: If612f8e282c1aa7014461f8878aa9721b30eeb42

includes/job/JobQueueDB.php

index b850610..e9af92a 100644 (file)
@@ -279,10 +279,7 @@ class JobQueueDB extends JobQueue {
         */
        protected function doAck( Job $job ) {
                $dbw = $this->getMasterDB();
-               if ( $dbw->trxLevel() ) {
-                       wfWarn( "Attempted to ack a job in a transaction; committing first." );
-                       $dbw->commit(); // push existing transaction
-               }
+               $dbw->commit( __METHOD__, 'flush' ); // flush existing transaction
 
                $autoTrx = $dbw->getFlag( DBO_TRX ); // automatic begin() enabled?
                $dbw->clearFlag( DBO_TRX ); // make each query its own transaction