Make sessions async

SQLiteSession is not updated, don't try to use it
This commit is contained in:
Tulir Asokan
2021-12-20 18:52:02 +02:00
committed by Lonami Exo
parent 43f629f665
commit d2de0f3aca
9 changed files with 54 additions and 80 deletions

View File

@@ -71,7 +71,7 @@ class UserMethods:
exceptions.append(e)
results.append(None)
continue
self.session.process_entities(result)
await self.session.process_entities(result)
self._entity_cache.add(result)
exceptions.append(None)
results.append(result)
@@ -82,7 +82,7 @@ class UserMethods:
return results
else:
result = await future
self.session.process_entities(result)
await self.session.process_entities(result)
self._entity_cache.add(result)
return result
except (errors.ServerError, errors.RpcCallFailError,
@@ -427,7 +427,7 @@ class UserMethods:
# No InputPeer, cached peer, or known string. Fetch from disk cache
try:
return self.session.get_input_entity(peer)
return await self.session.get_input_entity(peer)
except ValueError:
pass
@@ -567,7 +567,7 @@ class UserMethods:
try:
# Nobody with this username, maybe it's an exact name/title
return await self.get_entity(
self.session.get_input_entity(string))
await self.session.get_input_entity(string))
except ValueError:
pass