From f05257d833550c91616fdc45cfce650e728ce69e Mon Sep 17 00:00:00 2001 From: _ <> Date: Sun, 21 Mar 2021 15:43:31 +0000 Subject: [PATCH] :bug: bug fix requests timing out after 40 seconds. This is such a stupid bug. I swear I checked this exact piece of code for this exact bug and it wasn't there. But after I fixed it, I had no problem running a download for 11 hours straight. This fix won't affect a case where the firewall is actually closing long- running connections (which is bad behavior, but it could happen) or a case where the Internet is just flakey and the connection drops. But it will fix the most common case where both client and server are on robust connections and the download times out anyway. --- crates/ptth_server/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ptth_server/src/lib.rs b/crates/ptth_server/src/lib.rs index ae1da06..66db7d7 100644 --- a/crates/ptth_server/src/lib.rs +++ b/crates/ptth_server/src/lib.rs @@ -235,7 +235,7 @@ pub async fn run_server ( let client = Client::builder () .default_headers (headers) - .timeout (Duration::from_secs (40)) + .connect_timeout (Duration::from_secs (30)) .build ().map_err (ServerError::CantBuildHttpClient)?; let handlebars = file_server::load_templates (&asset_root)?;