X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FUserEditCountUpdate.php;h=4333c940421ddf9ae6362903ead9f9e5a62bec5c;hb=04cea76cbbd1c66ddfa2a674cf383ffb497234ae;hp=ed7e00cfba8f5071ede290766691c07b69fc6588;hpb=cca344a717b9e41b0e32e4915295cd36dd18bf83;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/UserEditCountUpdate.php b/includes/deferred/UserEditCountUpdate.php index ed7e00cfba..4333c94042 100644 --- a/includes/deferred/UserEditCountUpdate.php +++ b/includes/deferred/UserEditCountUpdate.php @@ -46,6 +46,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate { public function merge( MergeableUpdate $update ) { /** @var UserEditCountUpdate $update */ Assert::parameterType( __CLASS__, $update, '$update' ); + '@phan-var UserEditCountUpdate $update'; foreach ( $update->infoByUser as $userId => $info ) { if ( !isset( $this->infoByUser[$userId] ) ) { @@ -67,7 +68,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate { */ public function doUpdate() { $lb = MediaWikiServices::getInstance()->getDBLoadBalancer(); - $dbw = $lb->getConnection( DB_MASTER ); + $dbw = $lb->getConnectionRef( DB_MASTER ); $fname = __METHOD__; ( new AutoCommitUpdate( $dbw, __METHOD__, function () use ( $lb, $dbw, $fname ) { @@ -85,8 +86,8 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate { // The user_editcount is probably NULL (e.g. not initialized). // Since this update runs after the new revisions were committed, // wait for the replica DB to catch up so they will be counted. - $dbr = $lb->getConnection( DB_REPLICA ); - // If $dbr is actually the master DB, then clearing the snapshot is + $dbr = $lb->getConnectionRef( DB_REPLICA ); + // If $dbr is actually the master DB, then clearing the snapshot // is harmless and waitForMasterPos() will just no-op. $dbr->flushSnapshot( $fname ); $lb->waitForMasterPos( $dbr );