mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
11 lines
280 B
Python
11 lines
280 B
Python
|
from starlette.websockets import WebSocket, WebSocketState
|
||
|
|
||
|
|
||
|
async def is_websocket_alive(ws: WebSocket) -> bool:
|
||
|
if (
|
||
|
ws.application_state == WebSocketState.CONNECTED and
|
||
|
ws.client_state == WebSocketState.CONNECTED
|
||
|
):
|
||
|
return True
|
||
|
return False
|