cancel all tasks on exit

This commit is contained in:
Alexander Bersenev
2019-07-19 15:58:54 +05:00
parent 1c875e3d31
commit 7d11ff07bd

View File

@@ -1365,7 +1365,8 @@ def main():
except KeyboardInterrupt:
pass
stats_printer_task.cancel()
for task in asyncio.Task.all_tasks():
task.cancel()
if config.LISTEN_ADDR_IPV4:
server_v4.close()