Don't hang up page views with jobs
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 12 Sep 2008 17:01:41 +0000 (17:01 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 12 Sep 2008 17:01:41 +0000 (17:01 +0000)
includes/Wiki.php

index 101ba7f..c87f078 100644 (file)
@@ -328,12 +328,16 @@ class MediaWiki {
         */
        function finalCleanup ( &$deferredUpdates, &$output ) {
                wfProfileIn( __METHOD__ );
-               $this->doUpdates( $deferredUpdates );
-               $this->doJobs();
                # Now commit any transactions, so that unreported errors after output() don't roll back the whole thing
                $factory = wfGetLBFactory();
-               $factory->shutdown();
+               $factory->commitMasterChanges();
+               # Output everything!
                $output->output();
+               # Do any deferred jobs
+               $this->doUpdates( $deferredUpdates );
+               $this->doJobs();
+               # Commit and close up!
+               $factory->shutdown();
                wfProfileOut( __METHOD__ );
        }