mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(DB): set sharding parameters only when intended
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
e44f24f7ab
commit
381e922085
1 changed files with 10 additions and 5 deletions
|
|
@ -225,11 +225,16 @@ class ConnectionFactory {
|
|||
}
|
||||
|
||||
$connectionParams['sharding'] = $this->config->getValue('dbsharding', []);
|
||||
$connectionParams['shard_connection_manager'] = $this->shardConnectionManager;
|
||||
$connectionParams['auto_increment_handler'] = new AutoIncrementHandler(
|
||||
$this->cacheFactory,
|
||||
$this->shardConnectionManager,
|
||||
);
|
||||
if (!empty($connectionParams['sharding'])) {
|
||||
$connectionParams['shard_connection_manager'] = $this->shardConnectionManager;
|
||||
$connectionParams['auto_increment_handler'] = new AutoIncrementHandler(
|
||||
$this->cacheFactory,
|
||||
$this->shardConnectionManager,
|
||||
);
|
||||
} else {
|
||||
// just in case only the presence could lead to funny behaviour
|
||||
unset($connectionParams['sharding']);
|
||||
}
|
||||
|
||||
$connectionParams = array_merge($connectionParams, $additionalConnectionParams);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue