Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 22, 2025
1 parent c4d5e00 commit 2cf161f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions includes/Services/CreateWikiDataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use ObjectCacheFactory;
use Wikimedia\AtEase\AtEase;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Rdbms\IConnectionProvider;
use Wikimedia\Rdbms\IReadableDatabase;

class CreateWikiDataFactory {
Expand Down Expand Up @@ -40,7 +39,7 @@ class CreateWikiDataFactory {

public function __construct(
ObjectCacheFactory $objectCacheFactory,
private readonly IConnectionProvider $connectionProvider,
private readonly CreateWikiDatabaseUtils $databaseUtils,
private readonly CreateWikiHookRunner $hookRunner,
private readonly ServiceOptions $options
) {
Expand Down Expand Up @@ -140,7 +139,7 @@ public function resetDatabaseLists( bool $isNewChanges ): void {
return;
}

$this->dbr ??= $this->connectionProvider->getReplicaDatabase( 'virtual-createwiki' );
$this->dbr ??= $this->databaseUtils->getGlobalReplicaDB();

$databaseList = $this->dbr->newSelectQueryBuilder()
->table( 'cw_wikis' )
Expand Down Expand Up @@ -191,7 +190,7 @@ public function resetWikiData( bool $isNewChanges ): void {
);
}

$this->dbr ??= $this->connectionProvider->getReplicaDatabase( 'virtual-createwiki' );
$this->dbr ??= $this->databaseUtils->getGlobalReplicaDB();

$row = $this->dbr->newSelectQueryBuilder()
->select( '*' )
Expand All @@ -201,8 +200,7 @@ public function resetWikiData( bool $isNewChanges ): void {
->fetchRow();

if ( !$row ) {
$centralDbr = $this->connectionProvider->getReplicaDatabase( 'virtual-createwiki-central' );
if ( $this->wiki === $centralDbr->getDomainID() ) {
if ( $this->databaseUtils->isRemoteWikiCentral( $this->wiki ) ) {
// Don't throw an exception if we have not yet populated the
// central wiki, so that the PopulateCentralWiki script can
// successfully populate it.
Expand Down

0 comments on commit 2cf161f

Please sign in to comment.