Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Reduce logging verbosity of URL cache cleanup. (#7295)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkaye authored Apr 22, 2020
1 parent ff5604e commit 5308239
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/7295.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce log verbosity of url cache cleanup tasks.
9 changes: 7 additions & 2 deletions synapse/rest/media/v1/preview_url_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ async def _expire_url_cache_data(self):

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")
Expand Down Expand Up @@ -435,6 +435,8 @@ async def _expire_url_cache_data(self):

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
Expand Down Expand Up @@ -481,7 +483,10 @@ async def _expire_url_cache_data(self):

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):
Expand Down

0 comments on commit 5308239

Please sign in to comment.