diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-27 13:38:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 13:38:41 -0400 |
commit | 9b7ac03af3e7ceae7d1933db566ee407cfdef72d (patch) | |
tree | bd29b6da47cb08b846e05ce004f0e8d4008ed374 /synapse/storage/databases/main/profile.py | |
parent | simple_search_list_txn should return None, not 0. (#8187) (diff) | |
download | synapse-9b7ac03af3e7ceae7d1933db566ee407cfdef72d.tar.xz |
Convert calls of async database methods to async (#8166)
Diffstat (limited to 'synapse/storage/databases/main/profile.py')
-rw-r--r-- | synapse/storage/databases/main/profile.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/storage/databases/main/profile.py b/synapse/storage/databases/main/profile.py index 858fd92420..301875a672 100644 --- a/synapse/storage/databases/main/profile.py +++ b/synapse/storage/databases/main/profile.py @@ -66,8 +66,8 @@ class ProfileWorkerStore(SQLBaseStore): desc="get_from_remote_profile_cache", ) - def create_profile(self, user_localpart): - return self.db_pool.simple_insert( + async def create_profile(self, user_localpart: str) -> None: + await self.db_pool.simple_insert( table="profiles", values={"user_id": user_localpart}, desc="create_profile" ) @@ -93,13 +93,15 @@ class ProfileWorkerStore(SQLBaseStore): class ProfileStore(ProfileWorkerStore): - def add_remote_profile_cache(self, user_id, displayname, avatar_url): + async def add_remote_profile_cache( + self, user_id: str, displayname: str, avatar_url: str + ) -> None: """Ensure we are caching the remote user's profiles. This should only be called when `is_subscribed_remote_profile_for_user` would return true for the user. """ - return self.db_pool.simple_upsert( + await self.db_pool.simple_upsert( table="remote_profile_cache", keyvalues={"user_id": user_id}, values={ |