mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 14:14:56 -04:00
Convert additional databases to async/await part 2 (#8200)
This commit is contained in:
parent
bbb3c8641c
commit
da77520cd1
15 changed files with 111 additions and 81 deletions
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue