Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit da4aa7f

Browse files
committed
config: add option for how long to wait until media ID expires
1 parent 048a24a commit da4aa7f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/usage/configuration/config_documentation.md

+10
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,16 @@ Example configuration:
18201820
media_store_path: "DATADIR/media_store"
18211821
```
18221822
---
1823+
### `unused_expiration_time`
1824+
1825+
How long to wait in milliseconds before expiring created media IDs. Defaults to
1826+
"24h"
1827+
1828+
Example configuration:
1829+
```yaml
1830+
unused_expiration_time: "1h"
1831+
```
1832+
---
18231833
### `media_storage_providers`
18241834

18251835
Media storage providers allow media to be stored in different

synapse/config/repository.py

+4
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
141141
"prevent_media_downloads_from", []
142142
)
143143

144+
self.unused_expiration_time = self.parse_duration(
145+
config.get("unused_expiration_time", "24h")
146+
)
147+
144148
self.media_store_path = self.ensure_directory(
145149
config.get("media_store_path", "media_store")
146150
)

0 commit comments

Comments
 (0)