trading-ig
trading-ig copied to clipboard
WARNING:trading_ig.rest:Invalid session token, triggering refresh...
If I leave my code running, without any API calls for 12 hours then my token expires. When a new REST call is made I receive the above logged warning and then the TokenInvalidException
. The code does not seem to try to update the token before raising the error or catch the error in any way. I am using the v2 REST API.
I will test an attempted fix involving catching the error in the _req()
method that calls _request()
, calling the create_session()
method to refresh the token and then calling _req()
recursively.