mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-19 21:11:06 +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):
|
async def get(self):
|
||||||
result = await super().get()
|
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
|
return result
|
||||||
|
|
||||||
result = [result]
|
result = [result]
|
||||||
while not self.empty():
|
while not self.empty():
|
||||||
item = self.get_nowait()
|
item = self.get_nowait()
|
||||||
if isinstance(item.obj, MessageContainer):
|
if item == _reconnect_sentinel or\
|
||||||
|
isinstance(item.obj, MessageContainer):
|
||||||
self.put_nowait(item)
|
self.put_nowait(item)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user