diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 2905da979b8d..a5672e9dd14a 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1820,6 +1820,16 @@ Example configuration: media_store_path: "DATADIR/media_store" ``` --- +### `unused_expiration_time` + +How long to wait in milliseconds before expiring created media IDs. Defaults to +"24h" + +Example configuration: +```yaml +unused_expiration_time: "1h" +``` +--- ### `media_storage_providers` Media storage providers allow media to be stored in different diff --git a/synapse/config/repository.py b/synapse/config/repository.py index f6cfdd3e048a..dba9926779ba 100644 --- a/synapse/config/repository.py +++ b/synapse/config/repository.py @@ -141,6 +141,10 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None: "prevent_media_downloads_from", [] ) + self.unused_expiration_time = self.parse_duration( + config.get("unused_expiration_time", "24h") + ) + self.media_store_path = self.ensure_directory( config.get("media_store_path", "media_store") )