Skip to content

Add session health check and reconnect support to Info and Exchange class #293

@4stah

Description

@4stah

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions