question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

discogs: Apply rate limiting to all requests

See original GitHub issue

I have disabled Musicbrainz as discussed in #400 while I initially import my entire collection while in timid mode. I was running into exceptions every couple minutes as a result of HTTP 429 errors: discogs_client.exceptions.HTTPError: 429: You are making requests too quickly.

I found that there is a mechanism to limit requests to their API but that it is not evenly applied. Such as when setting an ID for a release, it was just being sent without any regard to the delay. I wrapped that call but still was running into issues; after finding a couple more calls to the API and wrapping them, I was able to keep the 429 errors from happening with such regularity. I then changed the rate limiter to 50 instead of 60 and haven’t seen a 429 since.

Here are the lines I wrapped with self.request_start() and self.request_finished(): https://github.com/beetbox/beets/blob/master/beetsplug/discogs.py#L218 https://github.com/beetbox/beets/blob/master/beetsplug/discogs.py#L268 https://github.com/beetbox/beets/blob/master/beetsplug/discogs.py#L294

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JOJ0commented, Dec 28, 2021

Very welcome, and a big big thank you back! beets is such an amazing tool! Still learning how to use it for my ideas but I am getting there and love it already 🤩

1reaction
sampsyocommented, Dec 26, 2021

Thank you for pointing this out! (And for maintaining the library!!) We removed all rate limiting on our side recently in https://github.com/beetbox/beets/pull/4118.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discogs Forum - Limit of 1 request per second
Discogs documented it as 1 request per seconds per IP but thats not competely true. In my case this is a good thing....
Read more >
discogs_rate_limit: Check Discogs API user rate limits - Rdrr.io
This function prints a users Discogs API rate limit information. All calls to the API deduct one unit from rate limits.
Read more >
ParkSquare.Discogs 1.0.34 - NuGet
Sign up to get a Discogs account and go to Developer Settings to create a new auth token. Not all endpoints require authentication,...
Read more >
Rate limit the number of request made from react client to API
In this API, there's a limit of max 60 request per minute. For managing this Discogs is adding custom values like "remaining requests",...
Read more >
Limiting the amount of REST calls in Mendix (most of the time)
All microflows that call the CRM integration will have the following settings: Rate limit 1; RatelimitQueue: “integrationCRM”. Rate limiting.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found