summary refs log tree commit diff
path: root/synapse/app/generic_worker.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-06-18 13:15:52 +0200
committerGitHub <noreply@github.com>2021-06-18 12:15:52 +0100
commit1b3e398bea8129fa7ae6fe28fd3a395fcd427ad9 (patch)
treed0b04f5f2c5f89c87c00761e3f615c41ceef4398 /synapse/app/generic_worker.py
parentExpose opentracing trace id in response headers (#10199) (diff)
downloadsynapse-1b3e398bea8129fa7ae6fe28fd3a395fcd427ad9.tar.xz
Standardise the module interface (#10062)
This PR adds a common configuration section for all modules (see docs). These modules are then loaded at startup by the homeserver. Modules register their hooks and web resources using the new `register_[...]_callbacks` and `register_web_resource` methods of the module API.
Diffstat (limited to 'synapse/app/generic_worker.py')
-rw-r--r--synapse/app/generic_worker.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py
index 57c2fc2e88..8e648c6ee0 100644
--- a/synapse/app/generic_worker.py
+++ b/synapse/app/generic_worker.py
@@ -354,6 +354,10 @@ class GenericWorkerServer(HomeServer):
                 if name == "replication":
                     resources[REPLICATION_PREFIX] = ReplicationRestResource(self)
 
+        # Attach additional resources registered by modules.
+        resources.update(self._module_web_resources)
+        self._module_web_resources_consumed = True
+
         root_resource = create_resource_tree(resources, OptionsResource())
 
         _base.listen_tcp(