From: Aaron Date: Fri, 21 Sep 2012 23:00:02 +0000 (-0700) Subject: Moved begin() since the lock() function may cause a BEGIN. X-Git-Tag: 1.31.0-rc.0~22310^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=480ead91e68e6119cc75377d30b5b68cf1a419d9;p=lhc%2Fweb%2Fwiklou.git Moved begin() since the lock() function may cause a BEGIN. Change-Id: Ib5f7d6b7464a27d08de12c63495374319ac09dfe --- diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 1c2c454d0d..422d606b05 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -286,6 +286,8 @@ 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 ) { @@ -306,9 +308,6 @@ 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 );