Skip to content

Commit

Permalink
Fix loading starting non-media repos
Browse files Browse the repository at this point in the history
Regressed in #17543.

The `max_download_size` config is not available on workers that don't
load the media repo.

Besides, we should honour the max_size param that was passed into the
function.
  • Loading branch information
erikjohnston committed Aug 29, 2024
1 parent a8f29c9 commit 45f54d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,6 @@ def __init__(
self.max_long_retries = hs.config.federation.max_long_retries
self.max_short_retries = hs.config.federation.max_short_retries

self.max_download_size = hs.config.media.max_upload_size

self._cooperator = Cooperator(scheduler=_make_scheduler(self.reactor))

self._sleeper = AwakenableSleeper(self.reactor)
Expand Down Expand Up @@ -1759,9 +1757,9 @@ async def federation_get_file(
str_url,
)
# We don't know how large the response will be upfront, so limit it to
# the `max_upload_size` config value.
# the `max_size` config value.
length, headers, _, _ = await self._simple_http_client.get_file(
str_url, output_stream, self.max_download_size
str_url, output_stream, max_size
)

logger.info(
Expand Down

0 comments on commit 45f54d5

Please sign in to comment.