mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-18 13:34:54 +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()
|
||||
|
||||
await self.recv_task
|
||||
if self.recv_task:
|
||||
await self.recv_task
|
||||
|
||||
self.recv_queue.put_nowait(None)
|
||||
|
||||
await self.net_worker_task
|
||||
if self.net_worker_task:
|
||||
await self.net_worker_task
|
||||
|
||||
for i in self.results.values():
|
||||
i.event.set()
|
||||
|
Loading…
Reference in New Issue
Block a user