From 90abb32bb94ab77f26a0e25d5a7f8c209aece246 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Mon, 29 Aug 2022 10:40:16 -0400 Subject: [PATCH 1/3] Do not wait for background updates to complete do expire URL cache entries. --- synapse/rest/media/v1/preview_url_resource.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index b36c98a08ea3..a8f6fd6b3578 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -732,10 +732,6 @@ async def _expire_url_cache_data(self) -> None: logger.debug("Running url preview cache expiry") - if not (await self.store.db_pool.updates.has_completed_background_updates()): - logger.debug("Still running DB updates; skipping url preview cache expiry") - return - def try_remove_parent_dirs(dirs: Iterable[str]) -> None: """Attempt to remove the given chain of parent directories From 519a28ef6a8c022f96f8c611671581cc6c52e515 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Mon, 29 Aug 2022 10:43:07 -0400 Subject: [PATCH 2/3] Newsfragment --- changelog.d/13657.bugfix | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog.d/13657.bugfix diff --git a/changelog.d/13657.bugfix b/changelog.d/13657.bugfix new file mode 100644 index 000000000000..296acf910cd8 --- /dev/null +++ b/changelog.d/13657.bugfix @@ -0,0 +1,2 @@ +Fix a long-standing bug that downloaded media for URL previews was not deleted while database background updates were +running. From 9f715cec3be58c794fa32661b97ce6a1af6d8424 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Mon, 29 Aug 2022 10:46:59 -0400 Subject: [PATCH 3/3] Fix line wrapping. --- changelog.d/13657.bugfix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/changelog.d/13657.bugfix b/changelog.d/13657.bugfix index 296acf910cd8..d314d9c52fa0 100644 --- a/changelog.d/13657.bugfix +++ b/changelog.d/13657.bugfix @@ -1,2 +1 @@ -Fix a long-standing bug that downloaded media for URL previews was not deleted while database background updates were -running. +Fix a long-standing bug that downloaded media for URL previews was not deleted while database background updates were running.