mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
fix(fetcher): back off on GitHub secondary limits in refresh cron
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -277,3 +277,16 @@ def test_repo_languages_capped_to_recent_owned_repos(monkeypatch):
|
||||
assert sorted(src.calls) == ["alice/mid", "alice/new"]
|
||||
assert repos[1]["language_bytes"] == {"Python": 1}
|
||||
assert "language_bytes" not in repos[0]
|
||||
|
||||
|
||||
@responses.activate
|
||||
def test_rate_limit_error_carries_retry_after():
|
||||
responses.add(
|
||||
responses.GET, "https://api.github.com/users/alice",
|
||||
json={"message": "You have exceeded a secondary rate limit."}, status=403,
|
||||
headers={"Retry-After": "42"},
|
||||
)
|
||||
src = github.DirectAPISource(token="t")
|
||||
with pytest.raises(github.GitHubTransientError) as exc:
|
||||
src.fetch_user_data("alice")
|
||||
assert exc.value.retry_after == 42
|
||||
|
||||
Reference in New Issue
Block a user