From 81c19a8a4f1c99f721d4c65fbcddcec6474b752b Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 01:11:29 +0100 Subject: http: add connect and request timeouts --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 56f81cb..132e93b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,7 +149,12 @@ async fn main() -> Result<(), Box> { let config = config::Config::from_env(); let db_pool = database::init_pool(&config.database_path).await?; - let http_client = reqwest::Client::new(); + // Connect timeout only: body timeouts are set per-call where a finite + // deadline makes sense (LLM/search/web), while media downloads may + // legitimately take a long time. + let http_client = reqwest::Client::builder() + .connect_timeout(Duration::from_secs(10)) + .build()?; let copyparty = copyparty::CopypartyClient::new( config.copyparty_url.clone(), -- cgit v1.2.3