Comments (4)
The API rate limit is 5000 HTTP requests per hour (not minutes as said above).
Let's say we want to backup issues.
A repo with more than 5000 issues, it starts to become a problem.
The theoritical limit is
- 1.38888 requests per second.
So we could artificially set a timer with one request per second and we would be safe.
A backup for issues in a repo of 40,000+ issues would "only " take 11h6m40s.
python-github-backup/bin/github-backup
Lines 453 to 454 in fac8e42
python-github-backup/bin/github-backup
Lines 409 to 451 in fac8e42
There is also this piece of code which use rate limiting but only in case there's already an error.
python-github-backup/bin/github-backup
Lines 505 to 534 in fac8e42
The strategy could be slightly different.
- Counting the HTTP requests: ๐
- Marking the time of the first request: ๐กโ (seconds)
- time of the current request: ๐ก๐ (seconds)
- rate, an optional parameter: rate โค 1.38
if ๐ > (๐ก๐ - ๐กโ) ร rate :
wait 1 sec before next request
from python-github-backup.
I am successfully using @eht16's throttling (๐) to keep below the rate limit when backing up very large orgs. I'm using --throttle-limit 5000 --throttle-pause 0.6
but YMMV. IMO @eth16's work should close this issue ๐
from python-github-backup.
There is not. Pull requests welcome.
from python-github-backup.
I've created a very simple throttling approach in #149.
This is not very clever and it simply pause API requests a fixed amount of seconds but it helps to stay within the rate limits.
My use case is: the GitHub API user used for the backup is also used elsewhere. It doesn't matter how long the backup takes as long as there are a few API requests left for the other uses.
from python-github-backup.
Related Issues (20)
- Procedures for Restore HOT 1
- Feature request: read personal access token (PAT) from stdin HOT 1
- The release script is broken HOT 1
- Personal Access Token (PAT) - Which scopes are need to backup an organiziation? HOT 1
- Add a --quiet option HOT 1
- Download watchers, forks, and stargazers of a repo
- A way to include the actual commits of backupped PRs?
- Add option to disable --prune when updating repository
- how to correctly update local backup? HOT 7
- Backup images and attachments in the issues
- Github-backup in 140 repository org backups nothing HOT 3
- Exclude specific repositories from backup HOT 1
- Add support for fine-grained tokens HOT 2
- Proposal to use API repository `pushed_at` instead of `update_at` field for `last_updated`
- something awry in --releases HOT 1
- When the `--lfs` option is used, after first clone non-lfs content is no longer fetched HOT 1
- Feature: offer docs how to run in docker HOT 4
- ERROR: 'gaierror' object is not iterable
- Automate releases HOT 5
- `--all-starred` does not backup anything HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-github-backup.