1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-29 02:08:10 +00:00

Clean exit when you Ctrl+C the server and client are still connected

This commit is contained in:
Julien Duponchelle 2016-08-18 15:04:43 +02:00
parent 5de27a95f9
commit 2842904769
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 4 additions and 1 deletions

View File

@ -222,7 +222,6 @@ class Route(object):
response.set_status(409)
response.json({"message": str(e), "status": 409, "image": e.image, "exception": e.__class__.__name__})
except asyncio.futures.CancelledError as e:
log.error("Request canceled")
response = Response(request=request, route=route)
response.set_status(408)
response.json({"message": "Request canceled", "status": 408})

View File

@ -112,6 +112,10 @@ class WebServer:
for task in asyncio.Task.all_tasks():
task.cancel()
try:
yield from asyncio.wait_for(task, 1)
except:
pass
self._loop.stop()