summary refs log tree commit diff
path: root/synapse/storage/background_updates.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-03-31 17:25:10 +0100
committerRichard van der Hoff <richard@matrix.org>2020-03-31 17:43:58 +0100
commit26d17b9bdc0de51d5f1a7526e8ab70e7f7796e4d (patch)
tree9ab1f5206d7690f006c54e79340ba02ba2734588 /synapse/storage/background_updates.py
parentRemove unused `start_background_update` (diff)
downloadsynapse-26d17b9bdc0de51d5f1a7526e8ab70e7f7796e4d.tar.xz
Make `has_completed_background_updates` async
(Almost) everywhere that uses it is happy with an awaitable.
Diffstat (limited to 'synapse/storage/background_updates.py')
-rw-r--r--synapse/storage/background_updates.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py
index d4e26eab6c..79494bcdf5 100644
--- a/synapse/storage/background_updates.py
+++ b/synapse/storage/background_updates.py
@@ -119,12 +119,11 @@ class BackgroundUpdater(object):
                     self._all_done = True
                     return None
 
-    @defer.inlineCallbacks
-    def has_completed_background_updates(self):
+    async def has_completed_background_updates(self) -> bool:
         """Check if all the background updates have completed
 
         Returns:
-            Deferred[bool]: True if all background updates have completed
+            True if all background updates have completed
         """
         # if we've previously determined that there is nothing left to do, that
         # is easy
@@ -138,7 +137,7 @@ class BackgroundUpdater(object):
         # otherwise, check if there are updates to be run. This is important,
         # as we may be running on a worker which doesn't perform the bg updates
         # itself, but still wants to wait for them to happen.
-        updates = yield self.db.simple_select_onecol(
+        updates = await self.db.simple_select_onecol(
             "background_updates",
             keyvalues=None,
             retcol="1",