summary refs log tree commit diff
path: root/synapse/app/user_dir.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-08-28 13:39:49 +0100
committerRichard van der Hoff <richard@matrix.org>2018-08-28 13:39:49 +0100
commit0b07f02e19e5ed1eba0e74c3863def9f849b5f9a (patch)
treedd17eca36b5b169dc25b309631b4522b3d516cc7 /synapse/app/user_dir.py
parentMerge pull request #3758 from matrix-org/erikj/admin_contact (diff)
downloadsynapse-0b07f02e19e5ed1eba0e74c3863def9f849b5f9a.tar.xz
Make sure that we close db connections opened during init
We should explicitly close any db connections we open, because failing to do so
can block other transactions as per
https://github.com/matrix-org/synapse/issues/3682.

Let's also try to factor out some of the boilerplate by having server classes
define their datastore class rather than duplicating the whole of `setup`.
Diffstat (limited to 'synapse/app/user_dir.py')
-rw-r--r--synapse/app/user_dir.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/synapse/app/user_dir.py b/synapse/app/user_dir.py
index 1388a42b59..96ffcaf073 100644
--- a/synapse/app/user_dir.py
+++ b/synapse/app/user_dir.py
@@ -94,10 +94,7 @@ class UserDirectorySlaveStore(
 
 
 class UserDirectoryServer(HomeServer):
-    def setup(self):
-        logger.info("Setting up.")
-        self.datastore = UserDirectorySlaveStore(self.get_db_conn(), self)
-        logger.info("Finished setting up.")
+    DATASTORE_CLASS = UserDirectorySlaveStore
 
     def _listen_http(self, listener_config):
         port = listener_config["port"]