The REST session in the Info and Exchange instances appears to expire after ~3 minutes of inactivity. It would be helpful to expose methods such as is_alive() and reconnect() (or similar) to handle this automatically.
BTW. WebSocket can be handled by:
def restart_WeSokects(): # Restart WebSockets if dead
global info
if not info.ws_manager or not info.ws_manager.is_alive():
# print("\n= WebSocket alive:",info.ws_manager.is_alive())
info.disconnect_websocket()
info.ws_manager = WebsocketManager(info.base_url)
info.ws_manager.start()
print("\n= Restart WebSocket:",info.ws_manager.is_alive())
return
The REST session in the Info and Exchange instances appears to expire after ~3 minutes of inactivity. It would be helpful to expose methods such as is_alive() and reconnect() (or similar) to handle this automatically.
BTW. WebSocket can be handled by:
def restart_WeSokects(): # Restart WebSockets if dead
global info
if not info.ws_manager or not info.ws_manager.is_alive():
# print("\n= WebSocket alive:",info.ws_manager.is_alive())
info.disconnect_websocket()
info.ws_manager = WebsocketManager(info.base_url)
info.ws_manager.start()
print("\n= Restart WebSocket:",info.ws_manager.is_alive())
return