Merge "Fixed unmatched begin/commit in SiteStatsUpdate."
authorReedy <reedy@wikimedia.org>
Tue, 12 Feb 2013 17:44:36 +0000 (17:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 12 Feb 2013 17:44:36 +0000 (17:44 +0000)
includes/SiteStats.php

index 01841b6..addaddd 100644 (file)
@@ -294,8 +294,6 @@ class SiteStatsUpdate implements DeferrableUpdate {
                        $this->doUpdatePendingDeltas();
                } else {
                        $dbw = wfGetDB( DB_MASTER );
-                       // Need a separate transaction because this a global lock
-                       $dbw->begin( __METHOD__ );
 
                        $lockKey = wfMemcKey( 'site_stats' ); // prepend wiki ID
                        if ( $rate ) {
@@ -316,6 +314,9 @@ class SiteStatsUpdate implements DeferrableUpdate {
                                $this->images   += ( $pd['ss_images']['+'] - $pd['ss_images']['-'] );
                        }
 
+                       // Need a separate transaction because this a global lock
+                       $dbw->begin( __METHOD__ );
+
                        // Build up an SQL query of deltas and apply them...
                        $updates = '';
                        $this->appendUpdate( $updates, 'ss_total_views', $this->views );