From 1859f993e9f79f3aa5a13796fdc4a25ad787bb9e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 21 Apr 2009 01:51:17 +0000 Subject: [PATCH] Made DB profiling work by actually committing it to the DB --- includes/Wiki.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index d873b9f20c..503bf8d4cc 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -335,14 +335,16 @@ class MediaWiki { } /** - * Cleaning up by doing deferred updates, calling LBFactory and doing the output + * Cleaning up request by doing: + ** deferred updates, DB transaction, and the output * * @param $deferredUpdates array of updates to do * @param $output OutputPage */ function finalCleanup( &$deferredUpdates, &$output ) { wfProfileIn( __METHOD__ ); - # Now commit any transactions, so that unreported errors after output() don't roll back the whole thing + # Now commit any transactions, so that unreported errors after + # output() don't roll back the whole DB transaction $factory = wfGetLBFactory(); $factory->commitMasterChanges(); # Output everything! @@ -350,8 +352,6 @@ class MediaWiki { # Do any deferred jobs $this->doUpdates( $deferredUpdates ); $this->doJobs(); - # Commit and close up! - $factory->shutdown(); wfProfileOut( __METHOD__ ); } @@ -422,6 +422,10 @@ class MediaWiki { */ function restInPeace() { wfLogProfilingData(); + # Commit and close up! + $factory = wfGetLBFactory(); + $factory->commitMasterChanges(); + $factory->shutdown(); wfDebug( "Request ended normally\n" ); } -- 2.20.1