-
Improvement
-
Resolution: Unresolved
-
Normal
-
None
-
2.2.3
-
None
Some servers return rate limit information in the server headers (Apiseeds does this now, but also MB services do it).
If should adapt our rate limiting code to adapt to this and respect the limiting reported by the service. There are some variations in this, though.
MB reports the rate limit like:
x-ratelimit-limit: 1200
x-ratelimit-remaining: 853
x-ratelimit-reset: 1575128422
Apiseed will respond with something like:
x-ratelimit-limit: 100
x-ratelimit-remaining: 0
x-retry-after: 60
The have a limit of 100 requests, once those are exhausted x-ratelimit-remaining will be 0 and x-retry-after gives a wait time in seconds.
For an implementation handling the MB rate limit see https://github.com/phw/rhythmbox-plugin-listenbrainz/blob/master/listenbrainz/client.py#L150
I think we could incorporate this in the existing rate limiting code.
- is related to
-
PICARD-2030 AcousticBrainz rate limiting incorrect
- Closed