diff options
author | Michael Kaye <1917473+michaelkaye@users.noreply.github.com> | 2020-04-22 12:45:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 07:45:16 -0400 |
commit | 5308239d5dc83e3a08594ba55377c269b2b86dcb (patch) | |
tree | e5a7c772ff5da744ee20d01bf9bed92cca0124a3 /synapse/rest | |
parent | import urllib.parse when using urllib.parse.quote (#7319) (diff) | |
download | synapse-5308239d5dc83e3a08594ba55377c269b2b86dcb.tar.xz |
Reduce logging verbosity of URL cache cleanup. (#7295)
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/media/v1/preview_url_resource.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index f68e18ea8a..f206605727 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -402,7 +402,7 @@ class PreviewUrlResource(DirectServeResource): now = self.clock.time_msec() - logger.info("Running url preview cache expiry") + logger.debug("Running url preview cache expiry") if not (await self.store.db.updates.has_completed_background_updates()): logger.info("Still running DB updates; skipping expiry") @@ -435,6 +435,8 @@ class PreviewUrlResource(DirectServeResource): if removed_media: logger.info("Deleted %d entries from url cache", len(removed_media)) + else: + logger.debug("No entries removed from url cache") # Now we delete old images associated with the url cache. # These may be cached for a bit on the client (i.e., they @@ -481,7 +483,10 @@ class PreviewUrlResource(DirectServeResource): await 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)) + else: + logger.debug("No media removed from url cache") def decode_and_calc_og(body, media_uri, request_encoding=None): |