mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #398] Spotipy freezes on large requests using next #232
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#232
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shillshocked on GitHub (Oct 17, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/398
After several minutes it will eventually freeze. No errors, just no further progress in retrieving a list of artists' albums. Anyway to bypass this?
I've tried retry libraries but still the same result.
@felix-hilden commented on GitHub (Oct 23, 2019):
Could you provide any additional information, like Artist ID?
@shillshocked commented on GitHub (Oct 23, 2019):
it's not specific to any URIs, it's just the way Spotipy is handling the connection.
I'm in an area with connectivity issues, so this is more of a problem for me than perhaps others. Nonetheless, the sessions code is not robust. I find that using a retrying (tenacity) decorator is the only way to handle this smoothly. I can also disable sessions in Spotipy but it still locks up on individual requests sometimes.
If I can implement a way to reset the adaptor in Python on failed requests, that would be the fastest way to address this. Connection resets when coupled with a retrying decorator will make it get over the hump without data loss handily.
Here is a way it is done with requests:
https://www.peterbe.com/plog/best-practice-with-retries-with-requests
I just can't figure out how to apply this example to Spotipy.
@shillshocked commented on GitHub (Oct 23, 2019):
Ah! This seems to help:
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager, requests_timeout=10)