Closed alololox closed 7 years ago
Sorry for the late reply. Never had issues with this myself, are you making calls to the Discogs API in a loop or something?
I thought there was no need for documentation as the rate limiting is done automatically. All calls that require rate limiting already implement it under the hood.
Yes, I'm making calls in a loop. I've got a JSON of albums that I'm searching discogs to grab an ID for, and then seaching masters by ID to pull image URLs.
So rate limiting has issues in loops? Any workaround suggestions for querying a large list of albums?
See https://www.discogs.com/developers/#page:home,header:home-rate-limiting
The current request limit is 240 requests per minute per IP. Once reached, you'll have to wait until 1 minute after the first request for another batch of 240 requests. queue.js
allows for a buffer of requests to be queued until the next minute interval. This is currently set to the default value of 20 for disconnect
, .
I think I'm going to make this buffer length configurable through client.js
like the other rate limiting settings to make it more flexible. Not sure what the memory usage effects are when setting a high value though. Until then you can just put a timer on your loop and after 240+20 requests have the loop timeout to 1 minute after the first request and proceed. It's basically what queue.js
does when filling its buffer.
Hey, not so much an issue but I can't seem to get rate limiting to work and I notice that theres no documentation for it in the readme. I've tried to replicate from the queue.js file but I'm still getting
{ [DiscogsError: Too many requests] statusCode: 429, message: 'Too many requests' }
Any chance of including an example?
Thanks for the awesome tool :)