fix(qobuz): back off between bundle-extraction retries
The 3 bundle-extraction attempts fired back-to-back, so a brief network hiccup (DNS blip, dropped connection, captive-portal redirect) failed all of them in a few ms and the retries were effectively useless — surfacing as "Failed to extract bundle tokens: Network error" at sign-in. Add a short growing delay (600ms, 1200ms) between attempts so a transient failure has time to clear. cc
This commit is contained in:
1 file changed
+8
@@ -199,6 +199,14 @@ pub async fn extract_and_cache_bundle_tokens(client: &Client) -> Result<BundleTo
|
||||
e
|
||||
);
|
||||
last_err = Some(e);
|
||||
// Back off before the next attempt. The attempts used to fire
|
||||
// back-to-back, so a brief network hiccup (DNS blip, dropped
|
||||
// connection, captive-portal redirect) failed all of them in a
|
||||
// few ms — the retries were effectively useless. A short growing
|
||||
// delay gives a transient failure time to clear.
|
||||
if attempt < attempts {
|
||||
tokio::time::sleep(Duration::from_millis(600 * attempt as u64)).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user