Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more automatic rate limiting #98

Merged
merged 2 commits into from
Jan 12, 2021
Merged

more automatic rate limiting #98

merged 2 commits into from
Jan 12, 2021

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Jan 11, 2021

Fix #9

This PR

  • renames the .quick_fetch function as it's not really quick. Its name no longer starts with a dot, as preparation for Consider exporting .fetch_results #82
  • uses ratelimitr for limiting the rate.

The default rate limit (30 requests per slot of 10 seconds) is what I've observed in headers. I update it after every API call. All of this because the Meetup API docs do not document how the rate could change. https://www.meetup.com/meetup_api/#limits

Example of code that would fail with the current package version but is automatically paced with this PR

for (i in 1:50) {
  lala <- get_events("rladies-nashville")
  print(Sys.time())
}

@maelle maelle requested review from ledell and drmowinckels January 11, 2021 15:25
@maelle
Copy link
Contributor Author

maelle commented Jan 11, 2021

One thing that worries me with our default app is whether other people could get requests throttled.

E.g. for the website it might be a better idea to create an OAuth app specific to the website. I wonder how many OAuth apps we can create with our pro account.

@maelle maelle merged commit 036ce41 into master Jan 12, 2021
@maelle maelle deleted the rate branch January 12, 2021 08:50
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.

Make rate limiting as automatic as possible
1 participant