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

Commit

Permalink
config: add option for how long to wait until media ID expires
Browse files Browse the repository at this point in the history
  • Loading branch information
sumnerevans committed Sep 5, 2023
1 parent 297ec61 commit 5061bf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,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
Expand Down
4 changes: 4 additions & 0 deletions synapse/config/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down

0 comments on commit 5061bf7

Please sign in to comment.