Skip to content

Commit

Permalink
Use ConnectionProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Nov 20, 2024
1 parent 334d0dd commit 3906658
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions maintenance/insertMissingLocalUserRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ public function execute() {
$dryRun = $this->getOption( 'dry-run', false );
$all = $this->getOption( 'all-wikis', false );

$centralDB = $this->getServiceContainer()->getDBLoadBalancerFactory()
->getMainLB( $this->getConfig()->get( 'CentralAuthDatabase' ) )
->getMaintenanceConnectionRef( DB_REPLICA, [], $this->getConfig()->get( 'CentralAuthDatabase' ) );
$connectionProvider = $this->getServiceContainer()->getConnectionProvider();
$centralDB = $connectionProvider->getReplicaDatabase( $this->getConfig()->get( 'CentralAuthDatabase' ) );

foreach ( ( $all ? $this->getConfig()->get( MainConfigNames::LocalDatabases ) : [ WikiMap::getCurrentWikiId() ] ) as $wiki ) {
$lb = $this->getServiceContainer()->getDBLoadBalancerFactory()->getMainLB( $wiki );

$res = $lb->getMaintenanceConnectionRef( DB_REPLICA, [], $wiki )->select(
$res = $connectionProvider->getReplicaDatabase( $wiki )->select(
'user',
[ 'user_name' ],
[
Expand Down

0 comments on commit 3906658

Please sign in to comment.