From 156fe696714297b164e6b979776f57c145f4501c Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Fri, 9 Jun 2023 14:15:15 -0600 Subject: [PATCH] fixup! config: add option for max pending media uploads Signed-off-by: Sumner Evans --- synapse/config/repository.py | 2 ++ synapse/media/media_repository.py | 1 + 2 files changed, 3 insertions(+) diff --git a/synapse/config/repository.py b/synapse/config/repository.py index dba9926779ba..839c026d70d7 100644 --- a/synapse/config/repository.py +++ b/synapse/config/repository.py @@ -145,6 +145,8 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None: config.get("unused_expiration_time", "24h") ) + self.max_pending_media_uploads = config.get("max_pending_media_uploads", 5) + self.media_store_path = self.ensure_directory( config.get("media_store_path", "media_store") ) diff --git a/synapse/media/media_repository.py b/synapse/media/media_repository.py index 0682709596eb..6d1c065633ba 100644 --- a/synapse/media/media_repository.py +++ b/synapse/media/media_repository.py @@ -80,6 +80,7 @@ def __init__(self, hs: "HomeServer"): self.max_upload_size = hs.config.media.max_upload_size self.max_image_pixels = hs.config.media.max_image_pixels self.unused_expiration_time = hs.config.media.unused_expiration_time + self.max_pending_media_uploads = hs.config.media.max_pending_media_uploads Thumbnailer.set_limits(self.max_image_pixels)