Skip to content

Use osu API rate limit headers - #41

Open
cmyui wants to merge 1 commit into
masterfrom
use-osu-rate-limit-headers
Open

Use osu API rate limit headers#41
cmyui wants to merge 1 commit into
masterfrom
use-osu-rate-limit-headers

Conversation

@cmyui

@cmyui cmyui commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

  • consume osu API X-Ratelimit-Remaining headers in the shared backoff path
  • open the v2 circuit after a successful response reports zero remaining quota, so the next request fails locally instead of becoming a 429
  • use X-Ratelimit-Reset as a cooldown fallback when Retry-After is absent
  • wire the header feedback into v2 beatmap/beatmapset/search responses and OAuth token refreshes

Upstream context

Tests

  • python3 -m unittest discover tests
  • python3 -m py_compile app/adapters/osu_api_backoff.py app/adapters/osu_api_v2/api.py app/oauth.py tests/test_osu_api_backoff.py
  • python3 -m mypy app/adapters/osu_api_backoff.py app/adapters/osu_api_v2/api.py app/oauth.py

@cmyui
cmyui requested a review from infernalfire72 as a code owner June 27, 2026 20:30
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

Successfully merging this pull request may close these issues.

1 participant