You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My script is running for such a long intervals because of the API rate limits, and to download call recordings for a day it is running from 7 to 12 hours.
Unfortunately, I have no time to investigate the SDK and just trying to implement such a method in my RingCentralApi class that is being called before each API call:
def_validate_token(self) ->None:
""" Checks if the token is about to expire within 60 seconds. This is an additional layer of security to already existing token expiration checks in the RingCentral SDK. """expire_time=self.platform.auth().data().get("expire_time", 0)
ifexpire_time<=time.time() +60orexpire_time==0:
self.platform.refresh()
UPD:
The workaround with the _validate_token() method didn't help. This time the script failed after 2 hours of running.
SDK version: ringcentral-0.9.0-py3-none-any.whl
The text was updated successfully, but these errors were encountered:
coldenol
changed the title
401 error / ApiException: Access token is expired in long-running scripts
ApiException: Access token is expired / 401 error in long-running scripts
Jun 27, 2024
There is an issue in getting a 401 error (ApiException: Access token is expired) after 9-10 hours of script working.
This is the possible place of the issue:
ringcentral-python/ringcentral/platform/auth.py
Line 120 in a61e873
My script is running for such a long intervals because of the API rate limits, and to download call recordings for a day it is running from 7 to 12 hours.
Unfortunately, I have no time to investigate the SDK and just trying to implement such a method in my
RingCentralApi
class that is being called before each API call:UPD:
The workaround with the
_validate_token()
method didn't help. This time the script failed after 2 hours of running.SDK version:
ringcentral-0.9.0-py3-none-any.whl
The text was updated successfully, but these errors were encountered: