mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-18 15:28:11 +00:00
Fix ConnectionResetError issues and switch to aiohttp version 3.4.4. Fixes #1474.
This commit is contained in:
@ -45,14 +45,14 @@ class NotificationHandler:
|
||||
request.app['websockets'].add(ws)
|
||||
asyncio.ensure_future(process_websocket(ws))
|
||||
with notifications.queue() as queue:
|
||||
while True:
|
||||
try:
|
||||
try:
|
||||
while True:
|
||||
notification = await queue.get_json(1)
|
||||
if ws.closed:
|
||||
break
|
||||
await ws.send_str(notification)
|
||||
except asyncio.futures.CancelledError:
|
||||
break
|
||||
finally:
|
||||
request.app['websockets'].discard(ws)
|
||||
finally:
|
||||
if not ws.closed:
|
||||
await ws.close()
|
||||
request.app['websockets'].discard(ws)
|
||||
return ws
|
||||
|
Reference in New Issue
Block a user