diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-08-28 13:39:49 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-08-28 13:39:49 +0100 |
commit | 0b07f02e19e5ed1eba0e74c3863def9f849b5f9a (patch) | |
tree | dd17eca36b5b169dc25b309631b4522b3d516cc7 /synapse/app/pusher.py | |
parent | Merge pull request #3758 from matrix-org/erikj/admin_contact (diff) | |
download | synapse-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/pusher.py')
-rw-r--r-- | synapse/app/pusher.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py index a4fc7e91fa..244c604de9 100644 --- a/synapse/app/pusher.py +++ b/synapse/app/pusher.py @@ -78,10 +78,7 @@ class PusherSlaveStore( class PusherServer(HomeServer): - def setup(self): - logger.info("Setting up.") - self.datastore = PusherSlaveStore(self.get_db_conn(), self) - logger.info("Finished setting up.") + DATASTORE_CLASS = PusherSlaveStore def remove_pusher(self, app_id, push_key, user_id): self.get_tcp_replication().send_remove_pusher(app_id, push_key, user_id) |