summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorAzrenbeth <7782548+Azrenbeth@users.noreply.github.com>2021-09-27 16:35:13 +0100
committerAzrenbeth <7782548+Azrenbeth@users.noreply.github.com>2021-09-27 16:35:13 +0100
commit596e13ce74da90b176767c8e719b327e057bcd83 (patch)
tree4866409abaa2e79df38f68a0702dee344b072695 /synapse
parentExtract password from db_args (diff)
downloadsynapse-596e13ce74da90b176767c8e719b327e057bcd83.tar.xz
Better search for state database
Diffstat (limited to 'synapse')
-rw-r--r--synapse/util/state_compressor.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/synapse/util/state_compressor.py b/synapse/util/state_compressor.py

index 672e6f91c9..6ec58dc9c6 100644 --- a/synapse/util/state_compressor.py +++ b/synapse/util/state_compressor.py
@@ -57,16 +57,14 @@ def setup_state_compressor(hs: "HomeServer"): return # Check that the database being used is postgres - if hs.get_datastores().state is not None: - for conf in hs.config.database.databases: - if conf.name == "state": - db_config = conf.config - break - else: - for conf in hs.config.database.databases: - if conf.name == "master": - db_config = conf.config - break + db_config = None + for conf in hs.config.database.databases: + if "state" in conf.databases: + db_config = conf.config + break + + # One of the databases should have the state tables in + assert db_config is not None if db_config["name"] != "psycopg2": return