From 1f89e31f3043946b6a0333cb408e33e7e73779f8 Mon Sep 17 00:00:00 2001 From: meehl <12648828+meehl@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:56:19 +0100 Subject: [PATCH] Set global timeout for ureq requests --- src/installer.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/installer.rs b/src/installer.rs index 4ac3f69..ddce0f2 100644 --- a/src/installer.rs +++ b/src/installer.rs @@ -19,7 +19,7 @@ use std::{ sync::mpsc::{self, Receiver, TryRecvError}, thread, }; -use ureq::http::Response; +use ureq::{Agent, config::Config, http::Response}; const REPO_NAME: &str = "meehl/rusty-pob-manifest"; @@ -486,9 +486,16 @@ fn http_get_with_backoff(url: &str) -> anyhow::Result> { let mut attempt = 0; let mut backoff_secs: u64 = 2; + let config = Agent::config_builder() + .timeout_global(Some(Duration::from_secs(10))) + .build(); + + let agent: Agent = config.into(); + loop { attempt += 1; - let resp_result = ureq::get(url) + let resp_result = agent + .get(url) .header("User-Agent", "rusty-path-of-building") .call();