From 3a978ac39d3b5ceec68cf89a7f767113825731f0 Mon Sep 17 00:00:00 2001 From: mxve <68632137+mxve@users.noreply.github.com> Date: Sat, 31 May 2025 16:36:27 +0200 Subject: [PATCH] add retry with increased timeout if all failed --- src/cdn.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cdn.rs b/src/cdn.rs index 85de482..59ea5b1 100644 --- a/src/cdn.rs +++ b/src/cdn.rs @@ -108,6 +108,12 @@ impl Hosts { let asn = crate::http::get_asn().await; hosts.rate(asn, true).await; + + if hosts.servers.iter().all(|server| server.rating == 0) { + info!("All CDN servers failed with 500ms timeout, retrying with 5000ms timeout"); + hosts.rate(asn, false).await; + } + hosts }