Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
let update_synapse_database run on a multi-database configurations (#…
Browse files Browse the repository at this point in the history
…13422)

* Allow sharded database in db migrate script

Signed-off-by: Finn Herzfeld <[email protected]>

* Update changelog.d/13422.bugfix

Co-authored-by: Patrick Cloke <[email protected]>

* Remove check entirely

* remove unused import

Signed-off-by: Finn Herzfeld <[email protected]>
Co-authored-by: finn <[email protected]>
Co-authored-by: Patrick Cloke <[email protected]>
  • Loading branch information
3 people authored Oct 19, 2022
1 parent 04d7f56 commit fe50738
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions changelog.d/13422.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a long-standing bug where the `update_synapse_database` script could not be run with multiple databases. Contributed by @thefinn93 @ Beeper.
8 changes: 0 additions & 8 deletions synapse/_scripts/update_synapse_database.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import argparse
import logging
import sys
from typing import cast

import yaml
Expand Down Expand Up @@ -100,13 +99,6 @@ def main() -> None:
# Load, process and sanity-check the config.
hs_config = yaml.safe_load(args.database_config)

if "database" not in hs_config and "databases" not in hs_config:
sys.stderr.write(
"The configuration file must have a 'database' or 'databases' section. "
"See https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#database"
)
sys.exit(4)

config = HomeServerConfig()
config.parse_config_dict(hs_config, "", "")

Expand Down

0 comments on commit fe50738

Please sign in to comment.