fcoury / octopi

A Ruby interface to GitHub API v2
http://hasmany.info/2009/4/18/ruby-interface-to-github-api
MIT License
216 stars 47 forks source link

Handle Rate Limiting #5

Open runpaint opened 15 years ago

runpaint commented 15 years ago

The API documentation hints that users are limited to a maximum of sixty requests per minute. We need to detect when we are being limited, and if necessary perform exponential backoff until the window has elapsed.

Hopefully we'll be able to detect rate limiting by looking at the status code, but if not we may need to use an internal counter.