From: daniel Date: Tue, 16 Oct 2012 11:18:41 +0000 (+0200) Subject: Use 'flush' flag to end automatic transactions. X-Git-Tag: 1.31.0-rc.0~22000^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=430870bad1fe170b36618f4d301a1edde98d0dee;p=lhc%2Fweb%2Fwiklou.git Use 'flush' flag to end automatic transactions. Call commit with the flush flag in JobQueueDB::doPop, so no warning is triggered if an automatic transaction is already in progress. Change-Id: I74f7170671103b0b1ea8afe09e3b105b03dde7e6 --- diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php index 3d584ef727..1dd1d44b0d 100644 --- a/includes/job/JobQueueDB.php +++ b/includes/job/JobQueueDB.php @@ -113,10 +113,7 @@ class JobQueueDB extends JobQueue { $uuid = wfRandomString( 32 ); // pop attempt $dbw = $this->getMasterDB(); - if ( $dbw->trxLevel() ) { - wfWarn( "Attempted to pop a job in a transaction; committing first." ); - $dbw->commit(); // push existing transaction - } + $dbw->commit( __METHOD__, 'flush' ); // flush existing transaction $job = false; // job popped off $autoTrx = $dbw->getFlag( DBO_TRX ); // automatic begin() enabled?