Closed FuadEfendi closed 5 hours ago
I found that it is something GitHub recently changed: rate limits
{"message":"API rate limit exceeded for xx.xx.xx.xx (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
I never had such issues before and I often add 1000-2000 files, it didn't happen. github.com/hbstack/revision
hits GitHub for each newly added (not committed yet) page.
I tried another project, which has about 1000 committed pages, this issue doesn't happen.
I think maybe my Internet speed is too fast ;) "rate limit" error rarely reproducible in the browser. I did commit changes, deployed successfully to Netlify, but still cannot run hugo server
locally. Repository is "public".
As a workaround, I disabled "revision" module locally.
each newly added (not committed yet) page
Newer created content should be excluded. I'll check this in a few days.
I believe these requests will count towards your account, regardless of the platform (local or remote, e.g Netlify).
The rate limit issue occurs if you make a high number of requests within an hour.
All of these requests count towards your personal rate limit of 5,000 requests per hour. https://docs.github.com/zh/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-authenticated-users
I'd suggest disable the hb.revision.repo_contributors
on config/development/params.yaml
, so that it won't make requests to GitHub on development.
BTW, even though the module caches those requests by modified date, you should still cache them (Hugo cachedir) on the platform side. Otherwise, the rate-limit counting will significantly increase on per deployment, since caches not found, module will re-make requests to API.
This is very strange; I heavily used the same config for another large site yesterday, it didn't happen at all. But I found one orphan unresponsive Hugo instance and killed it, maybe that's why.
It's hard to fix without breaking changes, see #111, which require --enableGitInfo
to be set and will break other sites after upgrading this module, so I'd leave this issue as open for now until find an ideal way.
Please enable the Git info feature after updating this module, otherwise the contributors section will never be displayed.
ERROR [github.com/hbstack/revision] failed to fetch https://api.github.com/repos/MasteryEducation/SecuritiesExamsMastery.ca/commits?path=content/13/12/3/2/index.md: failed to fetch remote resource from 'https://api.github.com/repos/MasteryEducation/SecuritiesExamsMastery.ca/commits?path=content/13/12/3/2/index.md': Forbidden