Convert simple_select_one and simple_select_one_onecol to async (#8162)

This commit is contained in:
Patrick Cloke 2020-08-26 07:19:32 -04:00 committed by GitHub
parent 56efa9ec71
commit 4c6c56dc58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 220 additions and 113 deletions

View file

@ -223,15 +223,15 @@ class EndToEndRoomKeyStore(SQLBaseStore):
return ret
def count_e2e_room_keys(self, user_id, version):
async def count_e2e_room_keys(self, user_id: str, version: str) -> int:
"""Get the number of keys in a backup version.
Args:
user_id (str): the user whose backup we're querying
version (str): the version ID of the backup we're querying about
user_id: the user whose backup we're querying
version: the version ID of the backup we're querying about
"""
return self.db_pool.simple_select_one_onecol(
return await self.db_pool.simple_select_one_onecol(
table="e2e_room_keys",
keyvalues={"user_id": user_id, "version": version},
retcol="COUNT(*)",