From 2dcc63f1a4a949b77a473449217e66379de8f5b6 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Fri, 9 Jun 2023 13:51:20 -0600 Subject: [PATCH] config: add option for max pending media uploads Signed-off-by: Sumner Evans --- docs/usage/configuration/config_documentation.md | 11 +++++++++++ synapse/config/repository.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 5d05bc51e2c0..66664359ef4f 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1764,6 +1764,17 @@ Example configuration: media_store_path: "DATADIR/media_store" ``` --- +### `max_pending_media_uploads` + +How many *pending media uploads* can a given user have? A pending media upload +is a created MXC URI that (a) is not expired (the `unused_expires_at` timestamp +has not passed) and (b) the media has not yet been uploaded for. Defaults to 5. + +Example configuration: +```yaml +max_pending_media_uploads: 5 +``` +--- ### `unused_expiration_time` How long to wait in milliseconds before expiring created media IDs. Defaults to 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") )