mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-16 19:41:07 +03:00
Make sure not to include sentinel in containers
This commit is contained in:
parent
bb2cacd525
commit
8086772506
|
@ -631,13 +631,15 @@ class _ContainerQueue(asyncio.Queue):
|
|||
"""
|
||||
async def get(self):
|
||||
result = await super().get()
|
||||
if self.empty() or isinstance(result.obj, MessageContainer):
|
||||
if self.empty() or result == _reconnect_sentinel or\
|
||||
isinstance(result.obj, MessageContainer):
|
||||
return result
|
||||
|
||||
result = [result]
|
||||
while not self.empty():
|
||||
item = self.get_nowait()
|
||||
if isinstance(item.obj, MessageContainer):
|
||||
if item == _reconnect_sentinel or\
|
||||
isinstance(item.obj, MessageContainer):
|
||||
self.put_nowait(item)
|
||||
break
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user