From 1f9be9ead2d27d12a167c0968d61fdda764cb617 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 7 Dec 2010 15:47:34 +0000 Subject: [PATCH] Per Nikerabbit, follow-up to r77972: use a string instead of boolean for readability --- includes/GlobalFunctions.php | 10 ++++++---- includes/Wiki.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index e9c8b858e2..c6d0ec7baa 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2860,9 +2860,10 @@ function wfMakeUrlIndex( $url ) { /** * Do any deferred updates and clear the list * - * @param $commit Boolean: commit after every update to prevent lock contention + * @param $commit String: set to 'commit' to commit after every update to + * prevent lock contention */ -function wfDoUpdates( $commit = false ) { +function wfDoUpdates( $commit = '' ) { global $wgDeferredUpdateList; wfProfileIn( __METHOD__ ); @@ -2873,14 +2874,15 @@ function wfDoUpdates( $commit = false ) { return; } - if ( $commit ) { + $doCommit = $commit == 'commit'; + if ( $doCommit ) { $dbw = wfGetDB( DB_MASTER ); } foreach ( $wgDeferredUpdateList as $update ) { $update->doUpdate(); - if ( $commit && $dbw->trxLevel() ) { + if ( $doCommit && $dbw->trxLevel() ) { $dbw->commit(); } } diff --git a/includes/Wiki.php b/includes/Wiki.php index 7440423a24..3b21a93430 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -371,7 +371,7 @@ class MediaWiki { // Output everything! $output->output(); // Do any deferred jobs - wfDoUpdates( true ); + wfDoUpdates( 'commit' ); // Close the session so that jobs don't access the current session session_write_close(); $this->doJobs(); -- 2.20.1