summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-08-29 13:26:17 +0100
committerErik Johnston <erik@matrix.org>2024-08-30 16:37:11 +0100
commitda58e55a0bd4169cc14c3b55deec3b84ce23efa3 (patch)
tree3814a6bdf5a6d20f8732f8ac61bf680fbcc4c058 /synapse/http/matrixfederationclient.py
parentFixup changelog (diff)
downloadsynapse-da58e55a0bd4169cc14c3b55deec3b84ce23efa3.tar.xz
Fix starting non-media repos (#17626)
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.
Diffstat (limited to '')
-rw-r--r--synapse/http/matrixfederationclient.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py

index 12c41c39e9..ecbbb6cfc4 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -464,8 +464,6 @@ class MatrixFederationHttpClient: 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) @@ -1759,9 +1757,9 @@ class MatrixFederationHttpClient: 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(