Tray exit lag fix
This commit is contained in:
+8
-1
@@ -790,7 +790,14 @@ async def _run(port: int, dc_opt: Dict[int, Optional[str]],
|
||||
async def wait_stop():
|
||||
await stop_event.wait()
|
||||
server.close()
|
||||
await server.wait_closed()
|
||||
me = asyncio.current_task()
|
||||
for task in list(asyncio.all_tasks()):
|
||||
if task is not me:
|
||||
task.cancel()
|
||||
try:
|
||||
await server.wait_closed()
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
asyncio.create_task(wait_stop())
|
||||
|
||||
async with server:
|
||||
|
||||
Reference in New Issue
Block a user