summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-09-28 16:08:08 +0100
committerErik Johnston <erik@matrix.org>2017-09-28 16:08:08 +0100
commitd5694ac5fa3266a777fa171f33bebc0d7477c12a (patch)
tree5e653f34c15b3b0b9a8155ce15022dd2781f8e82 /synapse/rest/media
parentHandle SERVFAILs when doing AAAA lookups for federation (#2477) (diff)
downloadsynapse-d5694ac5fa3266a777fa171f33bebc0d7477c12a.tar.xz
Only log if we've removed media
Diffstat (limited to 'synapse/rest/media')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 2300c263e0..895b480d5c 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -365,7 +365,8 @@ class PreviewUrlResource(Resource):
 
         yield self.store.delete_url_cache(removed_media)
 
-        logger.info("Deleted %d entries from url cache", len(removed_media))
+        if removed_media:
+            logger.info("Deleted %d entries from url cache", len(removed_media))
 
         # Now we delete old images associated with the url cache.
         # These may be cached for a bit on the client (i.e., they
@@ -412,7 +413,8 @@ class PreviewUrlResource(Resource):
 
         yield self.store.delete_url_cache_media(removed_media)
 
-        logger.info("Deleted %d media from url cache", len(removed_media))
+        if removed_media:
+            logger.info("Deleted %d media from url cache", len(removed_media))
 
 
 def decode_and_calc_og(body, media_uri, request_encoding=None):