summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/media_repository.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/media_repository.py b/synapse/storage/media_repository.py
index 5e39daa210..1f2eab98e3 100644
--- a/synapse/storage/media_repository.py
+++ b/synapse/storage/media_repository.py
@@ -267,7 +267,7 @@ class MediaRepositoryStore(SQLBaseStore):
     def get_url_cache_media_before(self, before_ts):
         sql = (
             "SELECT media_id FROM local_media_repository"
-            " WHERE created_ts < ?"
+            " WHERE created_ts < ? AND url_cache IS NOT NULL"
             " ORDER BY created_ts ASC"
             " LIMIT 100"
         )