mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 18:05:07 -04:00
Move background update handling out of store
This commit is contained in:
parent
8863624f78
commit
4a33a6dd19
27 changed files with 281 additions and 200 deletions
|
@ -181,7 +181,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
|
|||
Add the background updates we need to run.
|
||||
"""
|
||||
# Ugh, have to reset this flag
|
||||
self.store._all_done = False
|
||||
self.store.db.updates._all_done = False
|
||||
|
||||
self.get_success(
|
||||
self.store.db.simple_insert(
|
||||
|
@ -255,8 +255,12 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
|
|||
# Do the initial population of the user directory via the background update
|
||||
self._add_background_updates()
|
||||
|
||||
while not self.get_success(self.store.has_completed_background_updates()):
|
||||
self.get_success(self.store.do_next_background_update(100), by=0.1)
|
||||
while not self.get_success(
|
||||
self.store.db.updates.has_completed_background_updates()
|
||||
):
|
||||
self.get_success(
|
||||
self.store.db.updates.do_next_background_update(100), by=0.1
|
||||
)
|
||||
|
||||
shares_private = self.get_users_who_share_private_rooms()
|
||||
public_users = self.get_users_in_public_rooms()
|
||||
|
@ -290,8 +294,12 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
|
|||
# Do the initial population of the user directory via the background update
|
||||
self._add_background_updates()
|
||||
|
||||
while not self.get_success(self.store.has_completed_background_updates()):
|
||||
self.get_success(self.store.do_next_background_update(100), by=0.1)
|
||||
while not self.get_success(
|
||||
self.store.db.updates.has_completed_background_updates()
|
||||
):
|
||||
self.get_success(
|
||||
self.store.db.updates.do_next_background_update(100), by=0.1
|
||||
)
|
||||
|
||||
shares_private = self.get_users_who_share_private_rooms()
|
||||
public_users = self.get_users_in_public_rooms()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue