From: Aaron Schulz Date: Wed, 9 Jul 2014 20:02:22 +0000 (-0700) Subject: Avoid wfWaitForSlaves() call when in a transaction in ActiveUsers X-Git-Tag: 1.31.0-rc.0~14949^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=f49907ac0aa54f86e61ba50b7b9072fed316ee82;p=lhc%2Fweb%2Fwiklou.git Avoid wfWaitForSlaves() call when in a transaction in ActiveUsers * This does not do anything except waste time and connections. The query should be small in that case anyway. Change-Id: I010b3f09be36202ccf408e1a2b084fee0a598ff9 --- diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 8dc4b3c7a0..e25955f664 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -410,7 +410,9 @@ class SpecialActiveUsers extends SpecialPage { } foreach ( array_chunk( $newRows, 500 ) as $rowBatch ) { $dbw->insert( 'querycachetwo', $rowBatch, __METHOD__ ); - wfWaitForSlaves(); + if ( !$dbw->trxLevel() ) { + wfWaitForSlaves(); + } } }