mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Avoid packing more than 1024 messages in a single container
This commit is contained in:
@@ -53,8 +53,9 @@ class MessagePacker:
|
||||
batch = []
|
||||
size = 0
|
||||
|
||||
# Fill a new batch to return while the size is small enough
|
||||
while self._deque:
|
||||
# Fill a new batch to return while the size is small enough,
|
||||
# as long as we don't exceed the maximum length of messages.
|
||||
while self._deque and len(batch) <= MessageContainer.MAXIMUM_LENGTH:
|
||||
state = self._deque.popleft()
|
||||
size += len(state.data) + TLMessage.SIZE_OVERHEAD
|
||||
|
||||
|
Reference in New Issue
Block a user