spotify-player: slow the startup retry loop instead of multiplying it
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
efb49deabd
commit
3604875b55
1 changed files with 11 additions and 1 deletions
|
|
@ -84,10 +84,20 @@ in
|
|||
# The loop breaks on the first success, so a bigger bound costs nothing.
|
||||
# The CLI is no help here: `connect --name` resolves names against the Web
|
||||
# API device list, which doesn't contain the integrated device at all.
|
||||
#
|
||||
# Widen it by slowing the delay rather than by adding rounds: each round
|
||||
# costs up to three Web API calls, and we now share the bundled client ID
|
||||
# with every other spotify-player/ncspot user, so 60 one-second rounds was
|
||||
# ~180 requests per launch into a shared rate-limit bucket (429s). 12
|
||||
# rounds five seconds apart covers the same 60s for a fifth of the calls.
|
||||
# Both loops in this file are `for _ in 0..5` / `from_secs(1)`; the leading
|
||||
# indentation is what pins each replacement to initialize_playback.
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
substituteInPlace spotify_player/src/client/mod.rs \
|
||||
--replace-fail " for _ in 0..5 {" \
|
||||
" for _ in 0..60 {"
|
||||
" for _ in 0..12 {" \
|
||||
--replace-fail " let delay = std::time::Duration::from_secs(1);" \
|
||||
" let delay = std::time::Duration::from_secs(5);"
|
||||
'';
|
||||
});
|
||||
settings = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue