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

Log headers when hitting Github API rate limit #37

Open
njh opened this issue Jan 9, 2024 · 3 comments · May be fixed by #43
Open

Log headers when hitting Github API rate limit #37

njh opened this issue Jan 9, 2024 · 3 comments · May be fixed by #43

Comments

@njh
Copy link
Owner

njh commented Jan 9, 2024

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api

@80avin
Copy link

80avin commented Feb 1, 2024

I'll take this.
I already have more changes locally, like

  • parallel download of multiple repo/commits/users to speed up download
  • save as CSV files for faster processing.
    • saving large json on every download is slow as serialization is required.
    • json takes too much space.
    • CSV can be easily appended, making the save faster as we only add new rows instead of saving entire json object.
  • track etag/last-modified headers to download only if resource has changed
    • This saves the rate limit quota because unchanged resources are not downloaded.
  • if rate limit is reached, automatically wait for appropriate time.
  • Error handling

will push after some testing and cleanup

@njh
Copy link
Owner Author

njh commented Feb 1, 2024

That will be awesome, thanks!

I had thought that putting everything in a SQLite database would be desirable - but it would require quite a lot of re-engineering

@80avin 80avin linked a pull request Feb 3, 2024 that will close this issue
@80avin
Copy link

80avin commented Feb 3, 2024

I also thought of using the SQLite database. While it had a few advantages, they weren't significant enough to counter the human-readable factor of CSV.

NVM, I have pushed my changes in #43
You can review and give your suggestions there.

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 a pull request may close this issue.

2 participants