X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSiteStats.php;h=addaddd6989abf435723fcd13fb36ed2318e4531;hb=3dd34fee328915527de0f34edfc5927b96045aaa;hp=01841b67db88880f39887d8de8b898c700a7c737;hpb=a2743213104f6f4a9ebd38d1bd9802bc17e0ee2b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 01841b67db..addaddd698 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -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 );