airtable.py icon indicating copy to clipboard operation
airtable.py copied to clipboard

feat: add retry

Open thejuan opened this issue 3 years ago • 1 comments

Airtable rate limits to 5 requests per second across all bases. They return http code 429 when you hit this limit. This PR introduces retries via the requests retry functionality with back off so this error can be avoided.

I think this is a better approach than local rate limiting as there maybe multiple clients accessing the API, and is more aligned with the official node library


This change is Reviewable

thejuan avatar May 03 '21 03:05 thejuan

Please use requests_mock lib to mock response instead of adding a new library.

Unfortunately requests_mock uses a custom adapter, which replaces the retry adapter. It can't be used to test adapter features.

Will fix up the rest, do you use a formatter for these I can run?

thejuan avatar May 05 '21 06:05 thejuan