Create a new in-memory cache for entities (#1141)

This commit is contained in:
Lonami Exo
2019-03-26 11:27:21 +01:00
parent facf3ae582
commit 4d35e8c80f
5 changed files with 62 additions and 16 deletions

View File

@@ -49,6 +49,7 @@ class UserMethods(TelegramBaseClient):
results.append(None)
continue
self.session.process_entities(result)
self._entity_cache.add(result)
exceptions.append(None)
results.append(result)
request_index += 1
@@ -59,6 +60,7 @@ class UserMethods(TelegramBaseClient):
else:
result = await future
self.session.process_entities(result)
self._entity_cache.add(result)
return result
except (errors.ServerError, errors.RpcCallFailError,
errors.RpcMcgetFailError) as e: