Skip to content

Pace requests to avoid rate limits#8

Merged
philipithomas merged 5 commits intomasterfrom
avoid-ratelimit
Apr 2, 2016
Merged

Pace requests to avoid rate limits#8
philipithomas merged 5 commits intomasterfrom
avoid-ratelimit

Conversation

@philipithomas
Copy link
Member

By adding sleeps in after requests, we ensure that we are not rate limited.

We use this library internally at Staffjoy. We found that we were getting rate limited internally. As a matter of security, we treat internal services as hostile, so we decided to make this library safer by preventing behavior that could trigger a rate limit.

@philipithomas philipithomas merged commit 34111e4 into master Apr 2, 2016
@philipithomas philipithomas deleted the avoid-ratelimit branch April 2, 2016 23:26

class Resource:
# Seconds to sleep between requests (bc of rate limits)
REQUEST_SLEEP = 0.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like this can be brought down to 0.1 second?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments