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:
shay
2026-11-29 10:30:52 -08:00
co-authored by Claude Opus 5.5
parent e47a67d1a1
commit 53ae54fe98
7 changed files with 50 additions and 5 deletions
+3 -1
View File
@@ -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
}
+2 -1
View File
@@ -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,
+1 -1
View File
@@ -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."),
}