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

Commit 5061bf7

Browse files
committed
config: add option for how long to wait until media ID expires
1 parent 297ec61 commit 5061bf7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/usage/configuration/config_documentation.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,16 @@ Example configuration:
18051805
media_store_path: "DATADIR/media_store"
18061806
```
18071807
---
1808+
### `unused_expiration_time`
1809+
1810+
How long to wait in milliseconds before expiring created media IDs. Defaults to
1811+
"24h"
1812+
1813+
Example configuration:
1814+
```yaml
1815+
unused_expiration_time: "1h"
1816+
```
1817+
---
18081818
### `media_storage_providers`
18091819

18101820
Media storage providers allow media to be stored in different

synapse/config/repository.py

Lines changed: 4 additions & 0 deletions
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)