I'm using a basic python setup, following the session example on GitHub.
- import refinitiv.data as rd
- from refinitiv.data.content import fundamental_and_reference
- rd.open_session()
- # run routines ->
After a number of routines, some 1000 correct calls with http 200 I sometimes receive http code 401. Token de-activated. The only way to solve for this is to restart the script.
My question: How can I programmatically restart the session.
I would expect something as:
- response = fundamental_and_reference.Definition(universe=['example']).get_data()
- if response._http_status['http_status_code'] == 401:
- # solution like this would be nice:
- rd.restart_session()
rd.restart_session obviously does not exist. rd.close_session() and rd.open_session() does not work as well. The code freezes and does not continue.
In the previous answer I got referred to the GitHub, but there is no code explaining there what to do.
What can we do?