mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 02:25:45 +03:00
Sliding Sync: Shortcut for checking if certain background updates have completed (#17724)
Shortcut for checking if certain background updates have completed Pulling this change out from one of @erikjohnston's branches (https://github.com/element-hq/synapse/compare/develop...erikj/ss_perf) --------- Co-authored-by: Erik Johnston <erikj@element.io>
This commit is contained in:
parent
3c8a116e1a
commit
61b7c31772
2 changed files with 7 additions and 0 deletions
1
changelog.d/17724.misc
Normal file
1
changelog.d/17724.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Shortcut for checking if certain background updates have completed (utilized in Sliding Sync).
|
|
@ -490,6 +490,12 @@ class BackgroundUpdater:
|
||||||
if self._all_done:
|
if self._all_done:
|
||||||
return True
|
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(
|
rows = await self.db_pool.simple_select_many_batch(
|
||||||
table="background_updates",
|
table="background_updates",
|
||||||
column="update_name",
|
column="update_name",
|
||||||
|
|
Loading…
Reference in a new issue