mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Make sure to drain notification feed
Ref https://github.com/GNS3/gns3-gui/issues/1447
This commit is contained in:
parent
238421c415
commit
45471fc865
@ -224,6 +224,7 @@ class ProjectHandler:
|
|||||||
response.write(("{}\n".format(msg)).encode("utf-8"))
|
response.write(("{}\n".format(msg)).encode("utf-8"))
|
||||||
except asyncio.futures.CancelledError as e:
|
except asyncio.futures.CancelledError as e:
|
||||||
break
|
break
|
||||||
|
yield from response.drain()
|
||||||
|
|
||||||
if project.auto_close:
|
if project.auto_close:
|
||||||
# To avoid trouble with client connecting disconnecting we sleep few seconds before checking
|
# To avoid trouble with client connecting disconnecting we sleep few seconds before checking
|
||||||
|
@ -52,7 +52,7 @@ class NotificationQueue(asyncio.Queue):
|
|||||||
Return the content of the ping notification
|
Return the content of the ping notification
|
||||||
"""
|
"""
|
||||||
msg = {}
|
msg = {}
|
||||||
# Non blocking call in order to get cpu usage. First call will return 0
|
# Non blocking call in order to get cpu usage. First call will return 0
|
||||||
msg["cpu_usage_percent"] = psutil.cpu_percent(interval=None)
|
msg["cpu_usage_percent"] = psutil.cpu_percent(interval=None)
|
||||||
msg["memory_usage_percent"] = psutil.virtual_memory().percent
|
msg["memory_usage_percent"] = psutil.virtual_memory().percent
|
||||||
return msg
|
return msg
|
||||||
|
Loading…
Reference in New Issue
Block a user