diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-01-25 22:01:02 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-01-26 00:56:49 +0000 |
commit | 25adde9a04b82a2261404f9b6f9a25cec086f62f (patch) | |
tree | 248979282eb0ef9fa4343d1f5e535be966cf008b /synapse/app/federation_reader.py | |
parent | Remove spurious unittest.DEBUG (diff) | |
download | synapse-25adde9a04b82a2261404f9b6f9a25cec086f62f.tar.xz |
Factor out get_db_conn to HomeServer base class
This function is identical to all subclasses, so we may as well push it up to the base class to reduce duplication (and make use of it in the tests)
Diffstat (limited to 'synapse/app/federation_reader.py')
-rw-r--r-- | synapse/app/federation_reader.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/synapse/app/federation_reader.py b/synapse/app/federation_reader.py index a072291e1f..4de43c41f0 100644 --- a/synapse/app/federation_reader.py +++ b/synapse/app/federation_reader.py @@ -58,19 +58,6 @@ class FederationReaderSlavedStore( class FederationReaderServer(HomeServer): - def get_db_conn(self, run_new_connection=True): - # Any param beginning with cp_ is a parameter for adbapi, and should - # not be passed to the database engine. - db_params = { - k: v for k, v in self.db_config.get("args", {}).items() - if not k.startswith("cp_") - } - db_conn = self.database_engine.module.connect(**db_params) - - if run_new_connection: - self.database_engine.on_new_connection(db_conn) - return db_conn - def setup(self): logger.info("Setting up.") self.datastore = FederationReaderSlavedStore(self.get_db_conn(), self) |