diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-11-22 16:46:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-22 16:46:09 +0000 |
commit | 79eba878a78acc59908505d41c7890a29f5cc41b (patch) | |
tree | 6bbaf289bb72c86a5d1002f69934bd6f20e0ad29 /synapse/app/media_repository.py | |
parent | Merge pull request #2700 from matrix-org/rav/worker_docs (diff) | |
parent | Add config option to disable media_repo on main synapse (diff) | |
download | synapse-79eba878a78acc59908505d41c7890a29f5cc41b.tar.xz |
Merge pull request #2701 from matrix-org/rav/one_mediarepo_to_rule_them_all
Try to avoid having multiple PreviewUrlResource instances
Diffstat (limited to 'synapse/app/media_repository.py')
-rw-r--r-- | synapse/app/media_repository.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/app/media_repository.py b/synapse/app/media_repository.py index 36c18bdbcb..c4e5f0965d 100644 --- a/synapse/app/media_repository.py +++ b/synapse/app/media_repository.py @@ -35,7 +35,6 @@ from synapse.replication.slave.storage.registration import SlavedRegistrationSto from synapse.replication.slave.storage.transactions import TransactionStore from synapse.replication.tcp.client import ReplicationClientHandler 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.engines import create_engine from synapse.storage.media_repository import MediaRepositoryStore @@ -89,7 +88,7 @@ class MediaRepositoryServer(HomeServer): if name == "metrics": resources[METRICS_PREFIX] = MetricsResource(self) elif name == "media": - media_repo = MediaRepositoryResource(self) + media_repo = self.get_media_repository_resource() resources.update({ MEDIA_PREFIX: media_repo, LEGACY_MEDIA_PREFIX: media_repo, @@ -151,6 +150,13 @@ def start(config_options): assert config.worker_app == "synapse.app.media_repository" + if config.enable_media_repo: + _base.quit_with_error( + "enable_media_repo must be disabled in the main synapse process\n" + "before the media repo can be run in a separate worker.\n" + "Please add ``enable_media_repo: false`` to the main config\n" + ) + setup_logging(config, use_worker_options=True) events.USE_FROZEN_DICTS = config.use_frozen_dicts |