-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Instantiating balena with retry_rate_limited_request=True (e.g., balena = Balena({"retry_rate_limited_request": True})) does not trigger a retry when rate limit error is raised.
Observation:
The line self.__settings.get("retry_rate_limited_request") is True always evaluates to False, therefore a retry request is not executed
balena-sdk-python/balena/pine.py
Lines 71 to 79 in 840be13
| retry_after = req.headers.get("retry-after") | |
| if ( | |
| self.__settings.get("retry_rate_limited_request") is True | |
| and req.status_code == 429 | |
| and retry_after is not None | |
| and retry_after.isdigit() | |
| ): | |
| sleep(int(retry_after)) | |
| return self.__base_request(method, url, body) |
Possible Cause:
self.__settings.get(<key>) returns a value as a string.
Hence, self.__settings.get("retry_rate_limited_request") returns 'True' as a string and not boolean.
Metadata
Metadata
Assignees
Labels
No labels