forked from nextstrain/nextstrain.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Authenticate requests to the GitHub API (optionally)
This will alleviate somewhat the rate limits imposed on unauthenticated requests. As of this writing, authenticated requests get 5,000 requests/hour per authenticated user (_not_ per token). Unauthenticated requests get only 60 requests/hour per IP.¹ Resolves nextstrain#93. Other future changes to address rate limiting might include switching from simple fetch()es to an API client that does dynamic throttling to respect the rate limits. Octokit does a great job of making this easy, for example.² Complications with using Octokit include figuring out how to incorporate our current caching, or an equivalent. Caching is an important part of reducing these requests. Another complication is how long to retry before returning a 500 error to the nextstrain.org request; the example above retries indefinitely, but that's likely not what we want for nextstrain.org. ¹ https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting ² https://github.com/nextstrain/community-search/blob/ce1a4146878e8336c442a175033ad242621f5a17/find#L2-L25
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters