From 480ead91e68e6119cc75377d30b5b68cf1a419d9 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 21 Sep 2012 16:00:02 -0700 Subject: [PATCH] Moved begin() since the lock() function may cause a BEGIN. Change-Id: Ib5f7d6b7464a27d08de12c63495374319ac09dfe --- includes/SiteStats.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 ); -- 2.20.1