Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING:trading_ig.rest:Invalid session token, triggering refresh... #338

Open
btodac opened this issue Sep 25, 2024 · 0 comments
Open

WARNING:trading_ig.rest:Invalid session token, triggering refresh... #338

btodac opened this issue Sep 25, 2024 · 0 comments

Comments

@btodac
Copy link

btodac commented Sep 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant