hyperliquid-dex / hyperliquid-python-sdk

SDK for Hyperliquid API trading with Python.
MIT License
238 stars 97 forks source link

Websocket ping thread never ends #24

Open feltz opened 7 months ago

feltz commented 7 months ago

In websocket_manager.py, you could add the following so that the close of websocket will endthe thread too.

if self.ws.keep_running:
    self.ws.send(json.dumps({"method": "ping"}))
else:
    break

within:

    def send_ping(self):
        while True:
            time.sleep(50)
            logging.debug("Websocket sending ping")
            self.ws.send(json.dumps({"method": "ping"}))