cancel all tasks on exit

This commit is contained in:
Alexander Bersenev committed 2019-07-19 15:58:54 +05:00
1 parent 1c875e3d31
commit 7d11ff07bd
1 file changed
+2 -1
+2 -1
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()