diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2022-06-07 12:28:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 11:28:08 +0000 |
commit | c51f5b9592a8f7e44c132e7e63b96f0af34dfef3 (patch) | |
tree | bf14ac1418e4dbd4c201f2d2634335791f6f18ec | |
parent | Prevent local quarantined media from being claimed by media retention (#12972) (diff) | |
download | synapse-c51f5b9592a8f7e44c132e7e63b96f0af34dfef3.tar.xz |
Prevent breaking old sqlite's when media retention is enabled (#12977)
-rw-r--r-- | changelog.d/12977.feature | 1 | ||||
-rw-r--r-- | synapse/storage/databases/main/media_repository.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/12977.feature b/changelog.d/12977.feature new file mode 100644 index 0000000000..3c73363d28 --- /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 diff --git a/synapse/storage/databases/main/media_repository.py b/synapse/storage/databases/main/media_repository.py index 3c585c555a..d028be16de 100644 --- a/synapse/storage/databases/main/media_repository.py +++ b/synapse/storage/databases/main/media_repository.py @@ -327,7 +327,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore): 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]: |