summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-13 13:49:13 +0000
committerErik Johnston <erik@matrix.org>2018-03-13 16:37:41 +0000
commitb78717b87ba3fc248838db522f007c13d0cd8c76 (patch)
tree1bf42b30bc7260dcc2a25dafc8c61cdfe2358bbe /synapse/server.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/factor_rem... (diff)
downloadsynapse-b78717b87ba3fc248838db522f007c13d0cd8c76.tar.xz
Split RoomMemberHandler into base and master class
The intention here is to split the class into the bits that can be done
on workers and the bits that have to be done on the master.

In future there will also be a class that can be run on the worker,
which will delegate work to the master when necessary.
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 1bc8d6f702..3d47e2793b 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -46,7 +46,7 @@ from synapse.handlers.device import DeviceHandler
 from synapse.handlers.e2e_keys import E2eKeysHandler
 from synapse.handlers.presence import PresenceHandler
 from synapse.handlers.room_list import RoomListHandler
-from synapse.handlers.room_member import RoomMemberHandler
+from synapse.handlers.room_member import RoomMemberMasterHandler
 from synapse.handlers.set_password import SetPasswordHandler
 from synapse.handlers.sync import SyncHandler
 from synapse.handlers.typing import TypingHandler
@@ -387,7 +387,9 @@ class HomeServer(object):
         return SpamChecker(self)
 
     def build_room_member_handler(self):
-        return RoomMemberHandler(self)
+        if self.config.worker_app:
+            return Exception("Can't use RoomMemberHandler on workers")
+        return RoomMemberMasterHandler(self)
 
     def build_federation_registry(self):
         return FederationHandlerRegistry()