Moved begin() since the lock() function may cause a BEGIN.

Change-Id: Ib5f7d6b7464a27d08de12c63495374319ac09dfe
This commit is contained in:
Aaron 2012-09-21 16:00:02 -07:00
parent a6f899964c
commit 480ead91e6

View file

@ -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 );