diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-22 10:57:56 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-22 11:54:51 +0100 |
commit | 8810685df936ba60e0e9d36c9371c20f305c9126 (patch) | |
tree | cf5106c05f48f7b65c3ca99ca6f7647b12db67e6 /synapse/server.py | |
parent | Move consent config parsing into ConsentConfig (diff) | |
download | synapse-8810685df936ba60e0e9d36c9371c20f305c9126.tar.xz |
Stub out ServerNoticesSender on the workers
... and have the sync endpoints call it directly rather than obsure indirection via PresenceHandler
Diffstat (limited to 'synapse/server.py')
-rw-r--r-- | synapse/server.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/server.py b/synapse/server.py index e7c733f2d4..58dbf78437 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -74,6 +74,9 @@ from synapse.rest.media.v1.media_repository import ( ) from synapse.server_notices.server_notices_manager import ServerNoticesManager from synapse.server_notices.server_notices_sender import ServerNoticesSender +from synapse.server_notices.worker_server_notices_sender import ( + WorkerServerNoticesSender, +) from synapse.state import StateHandler, StateResolutionHandler from synapse.storage import DataStore from synapse.streams.events import EventSources @@ -403,9 +406,13 @@ class HomeServer(object): return FederationHandlerRegistry() def build_server_notices_manager(self): + if self.config.worker_app: + raise Exception("Workers cannot send server notices") return ServerNoticesManager(self) def build_server_notices_sender(self): + if self.config.worker_app: + return WorkerServerNoticesSender(self) return ServerNoticesSender(self) def remove_pusher(self, app_id, push_key, user_id): |