Migrate ILB::getConnectionRef() calls to ILB::getMaintenanceConnectionRef()

Deprecated since 1.39 (I6e7544763bd)

Remove deprecated ILB::reuseConnection() calls as well

Bug: T343277
Change-Id: I477c216fe75bb393fc892ded13f3d117b6fda4aa
This commit is contained in:
gerritbot 2023-08-01 20:59:02 +00:00 committed by Umherirrender
parent 02e4e6ac72
commit eb79e7b8b8

View file

@ -290,11 +290,10 @@ class LoginNotify implements LoggerAwareInterface {
$lb = MediaWikiServices::getInstance()
->getDBLoadBalancerFactory()
->getMainLB( $wiki );
$dbrLocal = $lb->getConnectionRef( DB_REPLICA, [], $wiki );
$dbrLocal = $lb->getMaintenanceConnectionRef( DB_REPLICA, [], $wiki );
if ( !$this->hasCheckUserTables( $dbrLocal ) ) {
// Skip this wiki, no checkuser table.
$lb->reuseConnection( $dbrLocal );
continue;
}
// FIXME The case where there are no CU entries for
@ -306,7 +305,6 @@ class LoginNotify implements LoggerAwareInterface {
);
if ( $res === self::USER_KNOWN ) {
$lb->reuseConnection( $dbrLocal );
return $res;
}
if ( $result === self::USER_NO_INFO
@ -314,7 +312,6 @@ class LoginNotify implements LoggerAwareInterface {
) {
$result = self::USER_NOT_KNOWN;
}
$lb->reuseConnection( $dbrLocal );
$count++;
}
}