-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented backoff. It works by simply fishing the Retry-After out o…
…f 429 responses and making a recursive call from that block in apiCall(). I've gone through trying to use async/await in a few more places to keep from getting entire barrages of 429 responses back, but that means sending off one request at a time from numerous places in csvData(), waiting for a response, checking it isn't 429, sending off the next request, etc., instead of sending volleys. That ends up being *really slow* for large playlists. Machine-gunning requests with a short delay between each simply works better, especially since I have to make 4 subsequent volleys per playlist (songs from playlist, unique artists, unique albums, song audio features). As a bonus of this process, I realized I don't really need to use delay when I'm fetching the list of playlists, since I already each response, which builds in a delay just due to message transit time to and from the server, and then I realized I could elmininate an unnecessary variable.
- Loading branch information
1 parent
b722dd2
commit b4cf03e
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters