From 07151faae8b033948ddd06a104607412432b677f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 26 Aug 2020 18:44:20 +1000 Subject: [PATCH] add escape hatch for very slow connections --- rslib/src/sync/http_client.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rslib/src/sync/http_client.rs b/rslib/src/sync/http_client.rs index 04fb67c75..9884ea307 100644 --- a/rslib/src/sync/http_client.rs +++ b/rslib/src/sync/http_client.rs @@ -80,12 +80,17 @@ pub struct Timeouts { impl Timeouts { pub fn new() -> Self { + let io_secs = if std::env::var("LONG_IO_TIMEOUT").is_ok() { + 3600 + } else { + 300 + }; Timeouts { connect_secs: 30, /// This is smaller than the I/O limit because it is just a /// default - some longer-running requests override it. request_secs: 60, - io_secs: 300, + io_secs, } } }