Increase Genius API interval from 1.5s to 2s to reduce 429 rate limits

Genius rate limits are undocumented but users hit 429s at ~40 req/min.
Bumping interval from 1.5s to 2s drops throughput to ~30 req/min which
stays under the threshold. No functional change — just slower enrichment.
This commit is contained in:
Broque Thomas 2026-04-01 08:42:55 -07:00
parent 778e68a844
commit 5d2215c1d2

View file

@ -11,7 +11,7 @@ logger = get_logger("genius_client")
# Global rate limiting variables
_last_api_call_time = 0
_api_call_lock = threading.Lock()
MIN_API_INTERVAL = 1.5 # 1.5s between calls — Genius 429s at 500ms
MIN_API_INTERVAL = 2.0 # 2s between calls — Genius rate limits are undocumented, ~30req/min is safe
_rate_limit_backoff = 0 # Extra backoff seconds after 429
_rate_limit_until = 0 # Timestamp until which all calls should wait