mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(launch): cap per-user language fetch at 40 repos, raise enrollment caps, fix cap message
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -262,7 +262,9 @@ export default function App() {
|
||||
return
|
||||
}
|
||||
if (r.status === 429 || status === 'rate_limited') {
|
||||
setFetchError('Enrollment limit reached — try again tomorrow')
|
||||
setFetchError((body as { cap?: string }).cap === 'daily'
|
||||
? 'Enrollment limit reached — try again tomorrow'
|
||||
: 'Enrollment limit reached — try again in an hour')
|
||||
setFetchDone(true)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -827,7 +827,8 @@ def get_user_data(username: str):
|
||||
# Daily cap is the abuse backstop: a botnet typing random names
|
||||
# can't burn through the GitHub PAT budget past this number.
|
||||
if _enrollment_capped():
|
||||
return jsonify({"status": "rate_limited"}), 429
|
||||
cap = "daily" if db.enrollments_today() >= config.ENROLLMENT_DAILY_CAP else "hourly"
|
||||
return jsonify({"status": "rate_limited", "cap": cap}), 429
|
||||
defaults = {
|
||||
"theme": "dark",
|
||||
"enabled": config.ENABLED_WIDGETS,
|
||||
|
||||
@@ -8,7 +8,7 @@ from .widgets.attribution import attribution_text
|
||||
|
||||
_MESSAGES = {
|
||||
"building": ("Building @{u}'s widget\u2026", "This usually takes under a minute."),
|
||||
"rate_limited": ("Too many new users today", "Try again tomorrow."),
|
||||
"rate_limited": ("Too many new users right now", "Try again later."),
|
||||
"not_found": ("GitHub user @{u} doesn't exist", "Check the spelling of the username."),
|
||||
"unsubstituted": ("Replace YOUR_USERNAME in the URL", "Put your own GitHub username there, e.g. /api/octocat."),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user