summary refs log tree commit diff
path: root/synapse/app/homeserver.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-11-21 11:08:08 +0000
committerRichard van der Hoff <richard@matrix.org>2017-11-22 16:19:49 +0000
commite1fd4751de8e96907ea97afaf91525e68ce22227 (patch)
treef7b2374e66930e40e0bf00a96f61e129a931dee4 /synapse/app/homeserver.py
parentMerge pull request #2700 from matrix-org/rav/worker_docs (diff)
downloadsynapse-e1fd4751de8e96907ea97afaf91525e68ce22227.tar.xz
Build MediaRepositoryResource as a homeserver dependency
This avoids the scenario where we have four different PreviewUrlResources
configured on a single app, each of which have their own caches and cache
clearing jobs.
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-xsynapse/app/homeserver.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 9e26146338..4b6164baa2 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -43,7 +43,6 @@ from synapse.rest import ClientRestResource
 from synapse.rest.key.v1.server_key_resource import LocalKey
 from synapse.rest.key.v2 import KeyApiV2Resource
 from synapse.rest.media.v0.content_repository import ContentRepoResource
-from synapse.rest.media.v1.media_repository import MediaRepositoryResource
 from synapse.server import HomeServer
 from synapse.storage import are_all_users_on_domain
 from synapse.storage.engines import IncorrectDatabaseSetup, create_engine
@@ -195,7 +194,7 @@ class SynapseHomeServer(HomeServer):
             })
 
         if name in ["media", "federation", "client"]:
-            media_repo = MediaRepositoryResource(self)
+            media_repo = self.get_media_repository_resource()
             resources.update({
                 MEDIA_PREFIX: media_repo,
                 LEGACY_MEDIA_PREFIX: media_repo,