summary refs log tree commit diff
path: root/synapse/replication/http/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-05-18 12:24:48 +0100
committerGitHub <noreply@github.com>2020-05-18 12:24:48 +0100
commit51055c8c4409e70e8f310fce420b2f2f7f7a257a (patch)
treeb460816865188f0a77722a72d804fac2c6daa6a9 /synapse/replication/http/__init__.py
parentMerge pull request #7519 from matrix-org/rav/kill_py2_code (diff)
downloadsynapse-51055c8c4409e70e8f310fce420b2f2f7f7a257a.tar.xz
Allow ReplicationRestResource to be added to workers (#7515)
This allows workers to talk to each other over HTTP replication.
Diffstat (limited to 'synapse/replication/http/__init__.py')
-rw-r--r--synapse/replication/http/__init__.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/replication/http/__init__.py b/synapse/replication/http/__init__.py
index 4613b2538c..a909744e93 100644
--- a/synapse/replication/http/__init__.py
+++ b/synapse/replication/http/__init__.py
@@ -34,9 +34,12 @@ class ReplicationRestResource(JsonResource):
 
     def register_servlets(self, hs):
         send_event.register_servlets(hs, self)
-        membership.register_servlets(hs, self)
         federation.register_servlets(hs, self)
-        login.register_servlets(hs, self)
-        register.register_servlets(hs, self)
-        devices.register_servlets(hs, self)
-        streams.register_servlets(hs, self)
+
+        # The following can't currently be instantiated on workers.
+        if hs.config.worker.worker_app is None:
+            membership.register_servlets(hs, self)
+            login.register_servlets(hs, self)
+            register.register_servlets(hs, self)
+            devices.register_servlets(hs, self)
+            streams.register_servlets(hs, self)