mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-18 21:44:22 +00:00
Await tasks before stopping the session
This commit is contained in:
parent
2b0746a140
commit
6da15b266d
@ -186,11 +186,11 @@ class Session:
|
|||||||
|
|
||||||
self.connection.close()
|
self.connection.close()
|
||||||
|
|
||||||
await self.recv_task
|
if self.recv_task:
|
||||||
|
await self.recv_task
|
||||||
|
|
||||||
self.recv_queue.put_nowait(None)
|
if self.net_worker_task:
|
||||||
|
await self.net_worker_task
|
||||||
await self.net_worker_task
|
|
||||||
|
|
||||||
for i in self.results.values():
|
for i in self.results.values():
|
||||||
i.event.set()
|
i.event.set()
|
||||||
|
Loading…
Reference in New Issue
Block a user