alpaca-trade-api-python icon indicating copy to clipboard operation
alpaca-trade-api-python copied to clipboard

Fix hanging close after Alpaca WebSocketException, add closing_timeout

Open drew-wallace opened this issue 5 years ago • 1 comments

This fixed an issue I was having where the Alpaca websocket would throw a warning and hang forever. Turns out, it was awaiting on closing the socket even though it was already closed. Setting the socket variable to None and letting it continue to _ensure_ws fixed the issue.

I also added a closing_timeout to the socket connection so it closes the fastest possible.

Finally, I fixed the streams variable being re-passed into subscribe as a Set instead of a List.

drew-wallace avatar Aug 28 '20 18:08 drew-wallace

There are 2 PRs with changing to a list on reconnect. LETS GET THIS DONE

nickvertucci avatar Mar 12 '21 10:03 nickvertucci