Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't refuse to start worker if media listener configured. #7002

Merged
merged 3 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7002.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Merge worker apps together.
34 changes: 20 additions & 14 deletions synapse/app/generic_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,26 @@ def _listen_http(self, listener_config):
elif name == "federation":
resources.update({FEDERATION_PREFIX: TransportLayerServer(self)})
elif name == "media":
media_repo = self.get_media_repository_resource()

# We need to serve the admin servlets for media on the
# worker.
admin_resource = JsonResource(self, canonical_json=False)
register_servlets_for_media_repo(self, admin_resource)

resources.update(
{
MEDIA_PREFIX: media_repo,
LEGACY_MEDIA_PREFIX: media_repo,
"/_synapse/admin": admin_resource,
}
)
if self.config.can_load_media_repo:
media_repo = self.get_media_repository_resource()

# We need to serve the admin servlets for media on the
# worker.
admin_resource = JsonResource(self, canonical_json=False)
register_servlets_for_media_repo(self, admin_resource)

resources.update(
{
MEDIA_PREFIX: media_repo,
LEGACY_MEDIA_PREFIX: media_repo,
"/_synapse/admin": admin_resource,
}
)
else:
logger.warning(
"A 'media' listener is configured but the media"
" repository is disabled. Ignoring."
)

if name == "openid" and "federation" not in res["names"]:
# Only load the openid resource separately if federation resource
Expand Down