From 666b583366a275168e45f9673e0709fc11808e7b Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 7 Jun 2022 11:59:36 +0100 Subject: [PATCH 1/2] Prevent breaking old sqlite's when media retention is enabled --- synapse/storage/databases/main/media_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/storage/databases/main/media_repository.py b/synapse/storage/databases/main/media_repository.py index 3c585c555ad3..d028be16de81 100644 --- a/synapse/storage/databases/main/media_repository.py +++ b/synapse/storage/databases/main/media_repository.py @@ -327,7 +327,7 @@ async def get_local_media_ids( if include_protected_media is False: # Do not include media that has been protected from quarantine sql += """ - AND safe_from_quarantine = false + AND NOT safe_from_quarantine """ def _get_local_media_ids_txn(txn: LoggingTransaction) -> List[str]: From a6f8b97cbb9dbb36aa70a0d64b5c8ad5137fc24a Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 7 Jun 2022 12:00:36 +0100 Subject: [PATCH 2/2] Changelog --- changelog.d/12977.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12977.feature diff --git a/changelog.d/12977.feature b/changelog.d/12977.feature new file mode 100644 index 000000000000..3c73363d28d2 --- /dev/null +++ b/changelog.d/12977.feature @@ -0,0 +1 @@ +Add new `media_retention` options to the homeserver config for routinely cleaning up non-recently accessed media. \ No newline at end of file