heroku / platform-api

Ruby HTTP client for the Heroku API
MIT License
213 stars 86 forks source link

Bug/feature: Rate-throttling logic is global and not per-token #112

Open schneems opened 4 years ago

schneems commented 4 years ago

When I added the rate-throttle logic I did so on the assumption that the process would be making requests on behalf of a single token. I think this is still the most common case, but I didn't account for the scenario where one process might make many requests using many different tokens (think if you've written some kind of a proxy service and operates on each individual token).

The way to move forward is to make the RateThrottleClient instance local to each instance of PlatformAPI. This will require work in Heroics since that's what we hook into to provide this feature.