summary refs log tree commit diff
path: root/synapse/storage/databases/main/openid.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-09-01 08:39:04 -0400
committerGitHub <noreply@github.com>2020-09-01 08:39:04 -0400
commitda77520cd1c414c9341da287967feb1bab14cbec (patch)
treeada9ea71a1271598a8bc2e9ab7c39a79ca928dac /synapse/storage/databases/main/openid.py
parentMake MultiWriterIDGenerator work for streams that use negative stream IDs (#8... (diff)
downloadsynapse-da77520cd1c414c9341da287967feb1bab14cbec.tar.xz
Convert additional databases to async/await part 2 (#8200)
Diffstat (limited to 'synapse/storage/databases/main/openid.py')
-rw-r--r--synapse/storage/databases/main/openid.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/openid.py b/synapse/storage/databases/main/openid.py
index 4db8949da7..2aac64901b 100644
--- a/synapse/storage/databases/main/openid.py
+++ b/synapse/storage/databases/main/openid.py
@@ -1,3 +1,5 @@
+from typing import Optional
+
 from synapse.storage._base import SQLBaseStore
 
 
@@ -15,7 +17,9 @@ class OpenIdStore(SQLBaseStore):
             desc="insert_open_id_token",
         )
 
-    def get_user_id_for_open_id_token(self, token, ts_now_ms):
+    async def get_user_id_for_open_id_token(
+        self, token: str, ts_now_ms: int
+    ) -> Optional[str]:
         def get_user_id_for_token_txn(txn):
             sql = (
                 "SELECT user_id FROM open_id_tokens"
@@ -30,6 +34,6 @@ class OpenIdStore(SQLBaseStore):
             else:
                 return rows[0][0]
 
-        return self.db_pool.runInteraction(
+        return await self.db_pool.runInteraction(
             "get_user_id_for_token", get_user_id_for_token_txn
         )