Skip to content

Commit

Permalink
Shortcut for checking if certain background updates have completed
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Sep 17, 2024
1 parent d40bc27 commit 7bc453d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synapse/storage/background_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ async def have_completed_background_updates(
if self._all_done:
return True

# We now check if we have completed all pending background updates. We
# do this as once this returns True then it will set `self._all_done`
# and we can skip checking the database in future.
if await self.has_completed_background_updates():
return True

rows = await self.db_pool.simple_select_many_batch(
table="background_updates",
column="update_name",
Expand Down

0 comments on commit 7bc453d

Please sign in to comment.