diff options
author | Erik Johnston <erik@matrix.org> | 2021-09-28 17:01:01 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2021-09-28 17:01:01 +0100 |
commit | 61c5650058df96211221e8d196ced0baab62ce46 (patch) | |
tree | b0694864bacbf91c79d9c413ca1c7c98c27c2902 | |
parent | Merge remote-tracking branch 'origin/develop' into azren/compressor_integration (diff) | |
download | synapse-61c5650058df96211221e8d196ced0baab62ce46.tar.xz |
Fix connectng to postgres when config has no host
-rw-r--r-- | synapse/storage/database.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 7f94cb00d6..b7881715bd 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -433,7 +433,11 @@ class DatabasePool: # to the DB). self.postgres_connection_info_parameters: Optional[Dict] = None if isinstance(self.engine, PostgresEngine): - self.postgres_connection_info_parameters = db_conn.info.dsn_parameters + self.postgres_connection_info_parameters = dict(db_conn.info.dsn_parameters) + # For some reason it doesn't always include the host, so explicitly + # include the things we care about from the info object + self.postgres_connection_info_parameters["host"] = db_conn.info.host + self.postgres_connection_info_parameters["user"] = db_conn.info.user if self.engine.can_native_upsert: # Check ASAP (and then later, every 1s) to see if we have finished |