nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
1.71k stars 402 forks source link

Betfair: improved session renewal #1644

Closed imemo88 closed 1 month ago

imemo88 commented 1 month ago

Pull Request

Two fixes: 1- Refresh the stream connection once a session is invalid (self._client.disconnect() has been replaced with self._disconnect() which disconnect both the client and stream) 2- Avoid multiple reconnect attempts if there are multiple INVALID_SESSION_INFORMATION errors in the current event queue

Type of change

How has this change been tested?

In Prod

cjdsellers commented 1 month ago

Thanks for the contribution @imemo88 :pray:.