Skip to content

Commit

Permalink
Spotify slow down
Browse files Browse the repository at this point in the history
  • Loading branch information
Marekkon5 committed Mar 14, 2024
1 parent 5fa3fc4 commit dbe4c7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/onetagger-platforms/src/spotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ impl Spotify {
F: Fn(&Spotify) -> ClientResult<R>
{
match f(self) {
Ok(r) => Ok(r),
Ok(r) => {
// Intentionally slow down to prevent rate limits
std::thread::sleep(Duration::from_millis(250));
Ok(r)
},
Err(ClientError::Http(http)) => {
match *http {
rspotify::http::HttpError::StatusCode(r) => {
Expand Down

0 comments on commit dbe4c7f

Please sign in to comment.