mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 11:52:11 -04:00
Add config options for media retention (#12732)
This commit is contained in:
parent
641908f72f
commit
2fc787c341
5 changed files with 353 additions and 2 deletions
|
@ -223,6 +223,22 @@ class ContentRepositoryConfig(Config):
|
|||
"url_preview_accept_language"
|
||||
) or ["en"]
|
||||
|
||||
media_retention = config.get("media_retention") or {}
|
||||
|
||||
self.media_retention_local_media_lifetime_ms = None
|
||||
local_media_lifetime = media_retention.get("local_media_lifetime")
|
||||
if local_media_lifetime is not None:
|
||||
self.media_retention_local_media_lifetime_ms = self.parse_duration(
|
||||
local_media_lifetime
|
||||
)
|
||||
|
||||
self.media_retention_remote_media_lifetime_ms = None
|
||||
remote_media_lifetime = media_retention.get("remote_media_lifetime")
|
||||
if remote_media_lifetime is not None:
|
||||
self.media_retention_remote_media_lifetime_ms = self.parse_duration(
|
||||
remote_media_lifetime
|
||||
)
|
||||
|
||||
def generate_config_section(self, data_dir_path: str, **kwargs: Any) -> str:
|
||||
assert data_dir_path is not None
|
||||
media_store = os.path.join(data_dir_path, "media_store")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue