summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-04-23 17:06:47 +0100
committerGitHub <noreply@github.com>2021-04-23 17:06:47 +0100
commit59d24c5bef4e05fa7be0cad1f7e63f0a0097374b (patch)
tree73d1af65fe53576035380929b3ee4b6836317ec9 /synapse/app
parentAdd type hints to auth and auth_blocking. (#9876) (diff)
downloadsynapse-59d24c5bef4e05fa7be0cad1f7e63f0a0097374b.tar.xz
pass a reactor into SynapseSite (#9874)
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/generic_worker.py1
-rw-r--r--synapse/app/homeserver.py25
2 files changed, 11 insertions, 15 deletions
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py
index 7b2ac3ca64..70e07d0574 100644
--- a/synapse/app/generic_worker.py
+++ b/synapse/app/generic_worker.py
@@ -367,6 +367,7 @@ class GenericWorkerServer(HomeServer):
                 listener_config,
                 root_resource,
                 self.version_string,
+                reactor=self.get_reactor(),
             ),
             reactor=self.get_reactor(),
         )
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 8be8b520eb..140f6bcdee 100644
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -126,19 +126,20 @@ class SynapseHomeServer(HomeServer):
         else:
             root_resource = OptionsResource()
 
-        root_resource = create_resource_tree(resources, root_resource)
+        site = SynapseSite(
+            "synapse.access.%s.%s" % ("https" if tls else "http", site_tag),
+            site_tag,
+            listener_config,
+            create_resource_tree(resources, root_resource),
+            self.version_string,
+            reactor=self.get_reactor(),
+        )
 
         if tls:
             ports = listen_ssl(
                 bind_addresses,
                 port,
-                SynapseSite(
-                    "synapse.access.https.%s" % (site_tag,),
-                    site_tag,
-                    listener_config,
-                    root_resource,
-                    self.version_string,
-                ),
+                site,
                 self.tls_server_context_factory,
                 reactor=self.get_reactor(),
             )
@@ -148,13 +149,7 @@ class SynapseHomeServer(HomeServer):
             ports = listen_tcp(
                 bind_addresses,
                 port,
-                SynapseSite(
-                    "synapse.access.http.%s" % (site_tag,),
-                    site_tag,
-                    listener_config,
-                    root_resource,
-                    self.version_string,
-                ),
+                site,
                 reactor=self.get_reactor(),
             )
             logger.info("Synapse now listening on TCP port %d", port)