moonraker: report websocket connection via /server/info
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
e76e83d8c1
commit
b1d739e032
|
@ -614,7 +614,8 @@ class Server:
|
||||||
'plugins': list(self.components.keys()),
|
'plugins': list(self.components.keys()),
|
||||||
'failed_plugins': self.failed_components,
|
'failed_plugins': self.failed_components,
|
||||||
'registered_directories': reg_dirs,
|
'registered_directories': reg_dirs,
|
||||||
'warnings': self.warnings
|
'warnings': self.warnings,
|
||||||
|
'websocket_count': self.get_websocket_manager().get_count()
|
||||||
}
|
}
|
||||||
|
|
||||||
async def _handle_config_request(self,
|
async def _handle_config_request(self,
|
||||||
|
|
|
@ -364,6 +364,9 @@ class WebsocketManager(APITransport):
|
||||||
for ws in list(self.websockets.values()):
|
for ws in list(self.websockets.values()):
|
||||||
ws.queue_message(msg)
|
ws.queue_message(msg)
|
||||||
|
|
||||||
|
def get_count(self) -> int:
|
||||||
|
return len(self.websockets)
|
||||||
|
|
||||||
async def close(self) -> None:
|
async def close(self) -> None:
|
||||||
if not self.websockets:
|
if not self.websockets:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue