summary refs log tree commit diff
path: root/synapse/util/state_compressor.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/util/state_compressor.py')
-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