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

No longer works on a lot of repositories (presumably > 10k commits) #173

Open
paulie-g opened this issue Mar 22, 2024 · 1 comment
Open

Comments

@paulie-g
Copy link

Describe the bug
Github returns 422 when GLOC queries for stats

To Reproduce
Steps to reproduce the behavior:

  1. Go to (https://github.com/paulie-g/redis-archive)
  2. Look at GLOC counter, it will say 'unavailable'
  3. Examine return code in dev tools
  4. It will say 422

Expected behavior
Number to be shown, 200 return code for stats query

Additional context
The github API docs for the stats/code_frequency endpoint now say:

Note: This endpoint can only be used for repositories with fewer than 10,000 commits. If the repository contains 10,000 or more commits, a 422 status code will be returned.

Presumably this is what's breaking GLOC? If it is, I can't think of a way around it using the current model.

@paulie-g
Copy link
Author

Maybe detect a 422 and use this 3rd-party API when we can't use Github?
https://codetabs.com/count-loc/count-loc-online.html

It's got a 1 request/5 seconds rate limit, so maybe only use on individual repo page.

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

No branches or pull requests

1 participant