Apply suggestion from @jmwample
Co-authored-by: Jack Wampler <jmwample@users.noreply.github.com>
This commit is contained in:
@@ -233,8 +233,6 @@ async fn resolve(
|
||||
Ok(Ok(lookup)) => {
|
||||
// Shuffle so that successive connection attempts cycle through all
|
||||
// returned IPs rather than always hitting the same first address.
|
||||
// This distributes retries across the full set of CDN edge nodes
|
||||
// even within the cache TTL window.
|
||||
let mut ips: Vec<IpAddr> = lookup.into_iter().collect();
|
||||
fastrand::shuffle(&mut ips);
|
||||
let addrs: Addrs = Box::new(ips.into_iter().map(|ip| SocketAddr::new(ip, 0)));
|
||||
|
||||
Reference in New Issue
Block a user