mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-10 10:13:59 -05:00
Convert additional database methods to async (select list, search, insert_many, delete_*) (#8168)
This commit is contained in:
parent
4a739c73b4
commit
30426c7063
8 changed files with 67 additions and 84 deletions
|
|
@ -414,13 +414,14 @@ class BackgroundUpdater(object):
|
|||
|
||||
self.register_background_update_handler(update_name, updater)
|
||||
|
||||
def _end_background_update(self, update_name):
|
||||
async def _end_background_update(self, update_name: str) -> None:
|
||||
"""Removes a completed background update task from the queue.
|
||||
|
||||
Args:
|
||||
update_name(str): The name of the completed task to remove
|
||||
update_name:: The name of the completed task to remove
|
||||
|
||||
Returns:
|
||||
A deferred that completes once the task is removed.
|
||||
None, completes once the task is removed.
|
||||
"""
|
||||
if update_name != self._current_background_update:
|
||||
raise Exception(
|
||||
|
|
@ -428,7 +429,7 @@ class BackgroundUpdater(object):
|
|||
% update_name
|
||||
)
|
||||
self._current_background_update = None
|
||||
return self.db_pool.simple_delete_one(
|
||||
await self.db_pool.simple_delete_one(
|
||||
"background_updates", keyvalues={"update_name": update_name}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue