pyairtable icon indicating copy to clipboard operation
pyairtable copied to clipboard

Reduce unnecessary sleep after API calls

Open mesozoic opened this issue 3 years ago • 0 comments
trafficstars

Right now ApiAbstract._iterate calls time.sleep before yielding the results of its first API call. This slows down operations that only retrieve a single record (or a single page of results) and it seems unnecessary unless we're about to request a second page of results.

This moves the time.sleep call to the end of the loop, so it only happens if we need to fetch a second page.

mesozoic avatar Sep 19 '22 23:09 mesozoic