Add tenacity retry for JSONDecodeError.

master
voussoir 2021-08-31 02:30:53 -07:00
parent 78cb1706ed
commit 57b7b08101
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ class Mega:
self.requests_session = requests.Session()
@tenacity.retry(
retry=tenacity.retry_if_exception_type(errors.EAGAIN),
retry=tenacity.retry_if_exception_type((errors.EAGAIN, json.decoder.JSONDecodeError)),
stop=tenacity.stop_after_attempt(10),
wait=tenacity.wait_exponential(multiplier=2, min=2, max=60),
)
def _api_request(self, request_data, params={}):