Skip to content

Commit

Permalink
fix: Avoid using replicas during setup
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Dec 28, 2023
1 parent 2362a96 commit 81b089c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/private/Setup/AbstractDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,12 @@ protected function connect(array $configOverwrite = []): Connection {
}
$connectionParams['host'] = $host;
}

$connectionParams = array_merge($connectionParams, ['primary' => $connectionParams, 'replica' => [$connectionParams]], $configOverwrite);
$connectionParams = array_merge($connectionParams, $configOverwrite);
$connectionParams = array_merge($connectionParams, ['primary' => $connectionParams, 'replica' => [$connectionParams]]);
$cf = new ConnectionFactory($this->config);
return $cf->getConnection($this->config->getValue('dbtype', 'sqlite'), $connectionParams);
$connection = $cf->getConnection($this->config->getValue('dbtype', 'sqlite'), $connectionParams);
$connection->ensureConnectedToPrimary();
return $connection;
}

/**
Expand Down

0 comments on commit 81b089c

Please sign in to comment.