Skip to content

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

@btodac

Description

@btodac

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions