summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-09-28 13:48:14 +0100
committerErik Johnston <erik@matrix.org>2017-09-28 13:48:14 +0100
commit93247a424a5068b088567fa98b6990e47608b7cb (patch)
treebbfa54ef0924e93816b1c2aaa346e7bead49e098 /synapse
parentFix typo in url cache expiry timer (diff)
downloadsynapse-93247a424a5068b088567fa98b6990e47608b7cb.tar.xz
Only pull out local media that were for url cache
Diffstat (limited to 'synapse')
-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"
         )