Use the new in-memory entity cache

This should avoid a disk access every time an input entity
is needed, which is very often. Another step for #1141.
This commit is contained in:
Lonami Exo
2019-03-26 11:39:25 +01:00
parent 4d35e8c80f
commit 8abc7ade22
10 changed files with 24 additions and 29 deletions

View File

@@ -362,10 +362,8 @@ class ChatAction(EventBuilder):
self._input_users = []
for peer in self._user_peers:
try:
self._input_users.append(
self._client.session.get_input_entity(peer)
)
except ValueError:
self._input_users.append(self._client._entity_cache[peer])
except KeyError:
pass
return self._input_users or []